Allow the ChromeClient to provide a custom ScrollingCoordinator
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jan 2014 20:45:24 +0000 (20:45 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jan 2014 20:45:24 +0000 (20:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=126450

Reviewed by Tim Horton.

Some platforms will want to provide a custom ScrollingCoordinator, so let
them do so by asking ChromeClient first for one.

* page/ChromeClient.h:
(WebCore::ChromeClient::createScrollingCoordinator):
* page/Page.cpp:
(WebCore::Page::scrollingCoordinator):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161279 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/Page.cpp

index 28cf01c..58dd894 100644 (file)
@@ -1,3 +1,18 @@
+2014-01-03  Simon Fraser  <simon.fraser@apple.com>
+
+        Allow the ChromeClient to provide a custom ScrollingCoordinator
+        https://bugs.webkit.org/show_bug.cgi?id=126450
+
+        Reviewed by Tim Horton.
+        
+        Some platforms will want to provide a custom ScrollingCoordinator, so let
+        them do so by asking ChromeClient first for one.
+
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::createScrollingCoordinator):
+        * page/Page.cpp:
+        (WebCore::Page::scrollingCoordinator):
+
 2014-01-03  Andreas Kling  <akling@apple.com>
 
         Deploy more child renderer iterators in RenderBlockFlow.
index 95f6ef8..a353e90 100644 (file)
@@ -34,6 +34,7 @@
 #include "PopupMenuClient.h"
 #include "RenderEmbeddedObject.h"
 #include "ScrollTypes.h"
+#include "ScrollingCoordinator.h"
 #include "SearchPopupMenu.h"
 #include "WebCoreKeyboardUIMode.h"
 #include <wtf/Forward.h>
@@ -322,6 +323,8 @@ public:
     virtual bool layerTreeStateIsFrozen() const { return false; }
 #endif
 
+    virtual PassRefPtr<ScrollingCoordinator> createScrollingCoordinator(Page*) const { return nullptr; }
+
 #if PLATFORM(WIN) && USE(AVFOUNDATION)
     virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const { return 0; }
 #endif
index be384b0..92862dd 100644 (file)
@@ -260,8 +260,11 @@ ViewportArguments Page::viewportArguments() const
 
 ScrollingCoordinator* Page::scrollingCoordinator()
 {
-    if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled())
-        m_scrollingCoordinator = ScrollingCoordinator::create(this);
+    if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) {
+        m_scrollingCoordinator = chrome().client().createScrollingCoordinator(this);
+        if (!m_scrollingCoordinator)
+            m_scrollingCoordinator = ScrollingCoordinator::create(this);
+    }
 
     return m_scrollingCoordinator.get();
 }