Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Get rid of WebUIClient
https://bugs.webkit.org/show_bug.cgi?id=128274 Reviewed by Andreas Kling. * UIProcess/API/APIUIClient.h: Added. (API::UIClient::~UIClient): (API::UIClient::createNewPage): (API::UIClient::showPage): (API::UIClient::close): (API::UIClient::takeFocus): (API::UIClient::focus): (API::UIClient::unfocus): (API::UIClient::runJavaScriptAlert): (API::UIClient::runJavaScriptConfirm): (API::UIClient::runJavaScriptPrompt): (API::UIClient::setStatusText): (API::UIClient::mouseDidMoveOverElement): (API::UIClient::unavailablePluginButtonClicked): (API::UIClient::implementsDidNotHandleKeyEvent): (API::UIClient::didNotHandleKeyEvent): (API::UIClient::implementsDidNotHandleWheelEvent): (API::UIClient::didNotHandleWheelEvent): (API::UIClient::toolbarsAreVisible): (API::UIClient::setToolbarsAreVisible): (API::UIClient::menuBarIsVisible): (API::UIClient::setMenuBarIsVisible): (API::UIClient::statusBarIsVisible): (API::UIClient::setStatusBarIsVisible): (API::UIClient::isResizable): (API::UIClient::setIsResizable): (API::UIClient::setWindowFrame): (API::UIClient::windowFrame): (API::UIClient::canRunBeforeUnloadConfirmPanel): (API::UIClient::runBeforeUnloadConfirmPanel): (API::UIClient::didDraw): (API::UIClient::pageDidScroll): (API::UIClient::exceededDatabaseQuota): (API::UIClient::runOpenPanel): (API::UIClient::decidePolicyForGeolocationPermissionRequest): (API::UIClient::decidePolicyForNotificationPermissionRequest): (API::UIClient::headerHeight): (API::UIClient::footerHeight): (API::UIClient::drawHeader): (API::UIClient::drawFooter): (API::UIClient::printFrame): (API::UIClient::canRunModal): (API::UIClient::runModal): (API::UIClient::saveDataToFileInDownloadsFolder): (API::UIClient::shouldInterruptJavaScript): (API::UIClient::showColorPicker): (API::UIClient::hideColorPicker): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::setUIClient): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::createNewPage): (WebKit::WebPageProxy::showPage): (WebKit::WebPageProxy::closePage): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::shouldInterruptJavaScript): (WebKit::WebPageProxy::setStatusText): (WebKit::WebPageProxy::mouseDidMoveOverElement): (WebKit::WebPageProxy::unavailablePluginButtonClicked): (WebKit::WebPageProxy::setToolbarsAreVisible): (WebKit::WebPageProxy::getToolbarsAreVisible): (WebKit::WebPageProxy::setMenuBarIsVisible): (WebKit::WebPageProxy::getMenuBarIsVisible): (WebKit::WebPageProxy::setStatusBarIsVisible): (WebKit::WebPageProxy::getStatusBarIsVisible): (WebKit::WebPageProxy::setIsResizable): (WebKit::WebPageProxy::getIsResizable): (WebKit::WebPageProxy::setWindowFrame): (WebKit::WebPageProxy::getWindowFrame): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::pageDidScroll): (WebKit::WebPageProxy::runOpenPanel): (WebKit::WebPageProxy::printFrame): (WebKit::WebPageProxy::didDraw): (WebKit::WebPageProxy::setFocus): (WebKit::WebPageProxy::takeFocus): (WebKit::WebPageProxy::didReceiveEvent): (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::exceededDatabaseQuota): (WebKit::WebPageProxy::requestGeolocationPermissionForFrame): (WebKit::WebPageProxy::requestNotificationPermission): (WebKit::WebPageProxy::headerHeight): (WebKit::WebPageProxy::footerHeight): (WebKit::WebPageProxy::drawHeader): (WebKit::WebPageProxy::drawFooter): (WebKit::WebPageProxy::runModal): (WebKit::WebPageProxy::setCanRunModal): (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder): * UIProcess/WebPageProxy.h: * UIProcess/WebUIClient.cpp: Removed. * UIProcess/WebUIClient.h: Removed. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformCreateInspectorPage): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::windowAndViewFramesChanged): * WebKit2.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/146277@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
738 additions
and 659 deletions.
- +108 −0 Source/WebKit2/ChangeLog
- +133 −0 Source/WebKit2/UIProcess/API/APIUIClient.h
- +430 −1 Source/WebKit2/UIProcess/API/C/WKPage.cpp
- +57 −49 Source/WebKit2/UIProcess/WebPageProxy.cpp
- +3 −3 Source/WebKit2/UIProcess/WebPageProxy.h
- +0 −459 Source/WebKit2/UIProcess/WebUIClient.cpp
- +0 −137 Source/WebKit2/UIProcess/WebUIClient.h
- +1 −1 Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
- +2 −1 Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
- +4 −8 Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,133 @@ | ||
/* | ||
* Copyright (C) 2014 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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. | ||
*/ | ||
|
||
#ifndef APIUIClient_h | ||
#define APIUIClient_h | ||
|
||
#include "WKPage.h" | ||
#include "WebEvent.h" | ||
#include "WebHitTestResult.h" | ||
#include <WebCore/FloatRect.h> | ||
#include <wtf/PassRefPtr.h> | ||
|
||
namespace WebCore { | ||
class ResourceRequest; | ||
struct WindowFeatures; | ||
} | ||
|
||
namespace WebKit { | ||
class GeolocationPermissionRequestProxy; | ||
class ImmutableDictionary; | ||
class NativeWebKeyboardEvent; | ||
class NativeWebWheelEvent; | ||
class NotificationPermissionRequest; | ||
class WebColorPickerResultListenerProxy; | ||
class WebFrameProxy; | ||
class WebOpenPanelParameters; | ||
class WebOpenPanelResultListenerProxy; | ||
class WebPageProxy; | ||
class WebSecurityOrigin; | ||
} | ||
|
||
namespace API { | ||
|
||
class Data; | ||
class Object; | ||
|
||
class UIClient { | ||
public: | ||
virtual ~UIClient() { } | ||
|
||
virtual PassRefPtr<WebKit::WebPageProxy> createNewPage(WebKit::WebPageProxy*, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, WebKit::WebEvent::Modifiers, WebKit::WebMouseEvent::Button) { return nullptr; } | ||
virtual void showPage(WebKit::WebPageProxy*) { } | ||
virtual void close(WebKit::WebPageProxy*) { } | ||
|
||
virtual void takeFocus(WebKit::WebPageProxy*, WKFocusDirection) { } | ||
virtual void focus(WebKit::WebPageProxy*) { } | ||
virtual void unfocus(WebKit::WebPageProxy*) { } | ||
|
||
virtual void runJavaScriptAlert(WebKit::WebPageProxy*, const WTF::String&, WebKit::WebFrameProxy*) { } | ||
virtual bool runJavaScriptConfirm(WebKit::WebPageProxy*, const WTF::String&, WebKit::WebFrameProxy*) { return false; } | ||
virtual WTF::String runJavaScriptPrompt(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy*) { return WTF::String(); } | ||
|
||
virtual void setStatusText(WebKit::WebPageProxy*, const WTF::String&) { } | ||
virtual void mouseDidMoveOverElement(WebKit::WebPageProxy*, const WebKit::WebHitTestResult::Data&, WebKit::WebEvent::Modifiers, API::Object*) { } | ||
#if ENABLE(NETSCAPE_PLUGIN_API) | ||
virtual void unavailablePluginButtonClicked(WebKit::WebPageProxy*, WKPluginUnavailabilityReason, WebKit::ImmutableDictionary*) { } | ||
#endif // ENABLE(NETSCAPE_PLUGIN_API) | ||
|
||
virtual bool implementsDidNotHandleKeyEvent() const { return false; } | ||
virtual void didNotHandleKeyEvent(WebKit::WebPageProxy*, const WebKit::NativeWebKeyboardEvent&) { } | ||
|
||
virtual bool implementsDidNotHandleWheelEvent() const { return false; } | ||
virtual void didNotHandleWheelEvent(WebKit::WebPageProxy*, const WebKit::NativeWebWheelEvent&) { } | ||
|
||
virtual bool toolbarsAreVisible(WebKit::WebPageProxy*) { return true; } | ||
virtual void setToolbarsAreVisible(WebKit::WebPageProxy*, bool) { } | ||
virtual bool menuBarIsVisible(WebKit::WebPageProxy*) { return true; } | ||
virtual void setMenuBarIsVisible(WebKit::WebPageProxy*, bool) { } | ||
virtual bool statusBarIsVisible(WebKit::WebPageProxy*) { return true; } | ||
virtual void setStatusBarIsVisible(WebKit::WebPageProxy*, bool) { } | ||
virtual bool isResizable(WebKit::WebPageProxy*) { return true; } | ||
virtual void setIsResizable(WebKit::WebPageProxy*, bool) { } | ||
|
||
virtual void setWindowFrame(WebKit::WebPageProxy*, const WebCore::FloatRect&) { } | ||
virtual WebCore::FloatRect windowFrame(WebKit::WebPageProxy*) { return WebCore::FloatRect(); } | ||
|
||
virtual bool canRunBeforeUnloadConfirmPanel() const { return false; } | ||
virtual bool runBeforeUnloadConfirmPanel(WebKit::WebPageProxy*, const WTF::String&, WebKit::WebFrameProxy*) { return true; } | ||
|
||
virtual void didDraw(WebKit::WebPageProxy*) { } | ||
virtual void pageDidScroll(WebKit::WebPageProxy*) { } | ||
|
||
virtual unsigned long long exceededDatabaseQuota(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::WebSecurityOrigin*, const WTF::String& databaseName, const WTF::String& databaseDisplayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage) { return currentQuota; } | ||
|
||
virtual bool runOpenPanel(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::WebOpenPanelParameters*, WebKit::WebOpenPanelResultListenerProxy*) { return false; } | ||
virtual bool decidePolicyForGeolocationPermissionRequest(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::WebSecurityOrigin*, WebKit::GeolocationPermissionRequestProxy*) { return false; } | ||
virtual bool decidePolicyForNotificationPermissionRequest(WebKit::WebPageProxy*, WebKit::WebSecurityOrigin*, WebKit::NotificationPermissionRequest*) { return false; } | ||
|
||
// Printing. | ||
virtual float headerHeight(WebKit::WebPageProxy*, WebKit::WebFrameProxy*) { return 0; } | ||
virtual float footerHeight(WebKit::WebPageProxy*, WebKit::WebFrameProxy*) { return 0; } | ||
virtual void drawHeader(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, const WebCore::FloatRect&) { } | ||
virtual void drawFooter(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, const WebCore::FloatRect&) { } | ||
virtual void printFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*) { } | ||
|
||
virtual bool canRunModal() const { return false; } | ||
virtual void runModal(WebKit::WebPageProxy*) { } | ||
|
||
virtual void saveDataToFileInDownloadsFolder(WebKit::WebPageProxy*, const WTF::String& suggestedFilename, const WTF::String& mimeType, const WTF::String& originatingURLString, API::Data*) { } | ||
|
||
virtual bool shouldInterruptJavaScript(WebKit::WebPageProxy*) { return false; } | ||
|
||
#if ENABLE(INPUT_TYPE_COLOR) | ||
virtual bool showColorPicker(WebKit::WebPageProxy*, const WTF::String&, WebKit::WebColorPickerResultListenerProxy*) { return false; } | ||
virtual bool hideColorPicker(WebKit::WebPageProxy*) { return false; } | ||
#endif | ||
}; | ||
|
||
} // namespace API | ||
|
||
#endif // APIUIClient_h |
Oops, something went wrong.