Provide a viewport parameter to disable clipping to the safe area
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / gtk / PageClientImpl.h
index e0c18e5..add3f66 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (C) 2010 Apple Inc. All rights reserved.
  * Portions Copyright (c) 2010 Motorola Mobility, Inc.  All rights reserved.
 #define PageClientImpl_h
 
 #include "DefaultUndoController.h"
-#include "KeyBindingTranslator.h"
 #include "PageClient.h"
 #include "WebFullScreenManagerProxy.h"
 #include "WebPageProxy.h"
-#include "WindowsKeyboardCodes.h"
 #include <WebCore/IntSize.h>
 #include <gtk/gtk.h>
+#include <memory>
 
 namespace WebKit {
 
@@ -48,84 +48,109 @@ class PageClientImpl : public PageClient
 #endif
 {
 public:
-    ~PageClientImpl();
-    static PassOwnPtr<PageClientImpl> create(GtkWidget* viewWidget)
-    {
-        return adoptPtr(new PageClientImpl(viewWidget));
-    }
+    explicit PageClientImpl(GtkWidget*);
 
     GtkWidget* viewWidget() { return m_viewWidget; }
 
 private:
-    explicit PageClientImpl(GtkWidget*);
-
     // PageClient
-    virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy() OVERRIDE;
-    virtual void setViewNeedsDisplay(const WebCore::IntRect&) OVERRIDE;
-    virtual void displayView() OVERRIDE;
-    virtual bool canScrollView() OVERRIDE { return false; }
-    virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) OVERRIDE;
-    virtual WebCore::IntSize viewSize() OVERRIDE;
-    virtual bool isViewWindowActive() OVERRIDE;
-    virtual bool isViewFocused() OVERRIDE;
-    virtual bool isViewVisible() OVERRIDE;
-    virtual bool isViewInWindow() OVERRIDE;
-    virtual void processDidCrash() OVERRIDE;
-    virtual void didRelaunchProcess() OVERRIDE;
-    virtual void pageClosed() OVERRIDE;
-    virtual void preferencesDidChange() OVERRIDE;
-    virtual void toolTipChanged(const WTF::String&, const WTF::String&) OVERRIDE;
-    virtual void setCursor(const WebCore::Cursor&) OVERRIDE;
-    virtual void setCursorHiddenUntilMouseMoves(bool) OVERRIDE;
-    virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&) OVERRIDE;
-    virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) OVERRIDE;
-    virtual void clearAllEditCommands() OVERRIDE;
-    virtual bool canUndoRedo(WebPageProxy::UndoOrRedo) OVERRIDE;
-    virtual void executeUndoRedo(WebPageProxy::UndoOrRedo) OVERRIDE;
-    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) OVERRIDE;
-    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) OVERRIDE;
-    virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) OVERRIDE;
-    virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) OVERRIDE;
-    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) OVERRIDE;
-    virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) OVERRIDE;
-    virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) OVERRIDE;
+    std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy() override;
+    void setViewNeedsDisplay(const WebCore::Region&) override;
+    void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll) override;
+    WebCore::FloatPoint viewScrollPosition() override;
+    WebCore::IntSize viewSize() override;
+    bool isViewWindowActive() override;
+    bool isViewFocused() override;
+    bool isViewVisible() override;
+    bool isViewInWindow() override;
+    void processDidExit() override;
+    void didRelaunchProcess() override;
+    void pageClosed() override;
+    void preferencesDidChange() override;
+    void toolTipChanged(const WTF::String&, const WTF::String&) override;
+    void setCursor(const WebCore::Cursor&) override;
+    void setCursorHiddenUntilMouseMoves(bool) override;
+    void didChangeViewportProperties(const WebCore::ViewportAttributes&) override;
+    void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) override;
+    void clearAllEditCommands() override;
+    bool canUndoRedo(WebPageProxy::UndoOrRedo) override;
+    void executeUndoRedo(WebPageProxy::UndoOrRedo) override;
+    WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) override;
+    WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) override;
+    WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) override;
+    WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) override;
+    void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) override;
+    RefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy&) override;
+    std::unique_ptr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy&, const ContextMenuContextData&, const UserData&) override;
 #if ENABLE(INPUT_TYPE_COLOR)
-    virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&) OVERRIDE;
+    RefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&) override;
 #endif
-    virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) OVERRIDE;
-    virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, const AtomicString&, Vector<WTF::String>&) OVERRIDE;
-    virtual void updateTextInputState() OVERRIDE;
-    virtual void startDrag(const WebCore::DragData&, PassRefPtr<ShareableBitmap> dragImage) OVERRIDE;
-    virtual bool isWindowVisible() OVERRIDE;
-
-#if USE(ACCELERATED_COMPOSITING)
-    virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) OVERRIDE;
-    virtual void exitAcceleratedCompositingMode() OVERRIDE;
-    virtual void updateAcceleratedCompositingMode(const LayerTreeContext&) OVERRIDE;
+    void selectionDidChange() override;
+#if ENABLE(DRAG_SUPPORT)
+    void startDrag(Ref<WebCore::SelectionData>&&, WebCore::DragOperation, RefPtr<ShareableBitmap>&& dragImage) override;
 #endif
 
-    virtual void handleDownloadRequest(DownloadProxy*) OVERRIDE;
-    virtual void didCommitLoadForMainFrame() OVERRIDE;
+    void enterAcceleratedCompositingMode(const LayerTreeContext&) override;
+    void exitAcceleratedCompositingMode() override;
+    void updateAcceleratedCompositingMode(const LayerTreeContext&) override;
+
+    void handleDownloadRequest(DownloadProxy*) override;
+    void didChangeContentSize(const WebCore::IntSize&) override;
+    void didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider) override;
+    void didFailLoadForMainFrame() override { }
 
     // Auxiliary Client Creation
 #if ENABLE(FULLSCREEN_API)
-    virtual WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() FINAL;
+    WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() final;
 #endif
 
 #if ENABLE(FULLSCREEN_API)
     // WebFullScreenManagerProxyClient
-    virtual void closeFullScreenManager() OVERRIDE;
-    virtual bool isFullScreen() OVERRIDE;
-    virtual void enterFullScreen() OVERRIDE;
-    virtual void exitFullScreen() OVERRIDE;
-    virtual void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) OVERRIDE;
-    virtual void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) OVERRIDE;
+    void closeFullScreenManager() override;
+    bool isFullScreen() override;
+    void enterFullScreen() override;
+    void exitFullScreen() override;
+    void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override;
+    void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override;
+#endif
+
+    void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&) override;
+
+    void navigationGestureDidBegin() override;
+    void navigationGestureWillEnd(bool, WebBackForwardListItem&) override;
+    void navigationGestureDidEnd(bool, WebBackForwardListItem&) override;
+    void navigationGestureDidEnd() override;
+    void willRecordNavigationSnapshot(WebBackForwardListItem&) override;
+    void didRemoveNavigationGestureSnapshot() override;
+
+    void didFirstVisuallyNonEmptyLayoutForMainFrame() override;
+    void didFinishLoadForMainFrame() override;
+    void didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) override;
+
+#if ENABLE(TOUCH_EVENTS)
+    void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) override;
 #endif
 
+    void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;
+
+    void didChangeBackgroundColor() override;
+
+    void refView() override;
+    void derefView() override;
+
+    void didRestoreScrollPosition() override { }
+
+#if ENABLE(VIDEO) && USE(GSTREAMER)
+    bool decidePolicyForInstallMissingMediaPluginsPermissionRequest(InstallMissingMediaPluginsPermissionRequest&) override;
+#endif
+
+    WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override { return WebCore::UserInterfaceLayoutDirection::LTR; }
+
+    void didChangeClipToSafeArea(bool) override { }
+
     // Members of PageClientImpl class
     GtkWidget* m_viewWidget;
     DefaultUndoController m_undoController;
-    WebCore::KeyBindingTranslator m_keyBindingTranslator;
 };
 
 } // namespace WebKit