haikuwebkit/Source/WebCore/platform/CaptionPreferencesDelegate.h

45 lines
1.7 KiB
C
Raw Permalink Normal View History

Set Caption preferences in the UI process https://bugs.webkit.org/show_bug.cgi?id=227742 <rdar://79040526> Reviewed by Eric Carlson. Source/WebCore: Add a Caption user preferences delegate, which can be subclassed to perform the work in the UI process. No new tests, since this is not trivial to add a test for. This has been manually tested. * WebCore.xcodeproj/project.pbxproj: * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::captionPreferencesDelegate): (WebCore::CaptionUserPreferencesMediaAF::captionDisplayMode const): (WebCore::CaptionUserPreferencesMediaAF::platformSetCaptionDisplayMode): (WebCore::CaptionUserPreferencesMediaAF::setCaptionDisplayMode): (WebCore::CaptionUserPreferencesMediaAF::setCaptionPreferencesDelegate): (WebCore::CaptionUserPreferencesMediaAF::platformSetPreferredLanguage): (WebCore::CaptionUserPreferencesMediaAF::setPreferredLanguage): * page/CaptionUserPreferencesMediaAF.h: * platform/CaptionPreferencesDelegate.h: Added. (WebCore::CaptionPreferencesDelegate::~CaptionPreferencesDelegate): (WebCore::CaptionPreferencesDelegate::setDisplayMode): Source/WebKit: Subclass the Caption user preferences delegate, which will send messages to the UI process, requesting to set the preferences. * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::setCaptionDisplayMode): (WebKit::WebProcessProxy::setCaptionLanguage): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebCaptionPreferencesDelegate.cpp: Added. (WebKit::WebCaptionPreferencesDelegate::setDisplayMode): (WebKit::WebCaptionPreferencesDelegate::setPreferredLanguage): * WebProcess/WebCoreSupport/WebCaptionPreferencesDelegate.h: Added. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Canonical link: https://commits.webkit.org/239508@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-08 11:46:21 +00:00
/*
* Copyright (C) 2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
#include "CaptionUserPreferences.h"
namespace WebCore {
class CaptionPreferencesDelegate {
public:
virtual ~CaptionPreferencesDelegate() { }
virtual void setDisplayMode(CaptionUserPreferences::CaptionDisplayMode) { }
virtual void setPreferredLanguage(const String&) { }
};
} // namespace WebCore
#endif