Skip to content
Permalink
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
Anders Carlsson committed Feb 5, 2014
1 parent fddc13b commit 4adaf5911ccc3b48d0fd59c811d5bfa7b55959b8
@@ -1,3 +1,111 @@
2014-02-05 Anders Carlsson <andersca@apple.com>

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:

2014-02-05 Enrica Casucci <enrica@apple.com>

WK2: Caret, selections and autocorrection bubbles are incorrectly positioned when inside an iframe.
@@ -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

0 comments on commit 4adaf59

Please sign in to comment.