Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / page / scrolling / ScrollingCoordinator.h
index 2423b1d..58c0e9e 100644 (file)
 #include "wtf/text/WTFString.h"
 
 namespace blink {
-class WebLayer;
 class WebScrollbarLayer;
 }
 
-namespace WebCore {
+namespace blink {
 
 typedef unsigned MainThreadScrollingReasons;
 
-class Document;
 class LocalFrame;
 class FrameView;
 class GraphicsLayer;
 class Page;
 class Region;
 class ScrollableArea;
-class ViewportConstraints;
 
 class ScrollingCoordinator {
 public:
-    static PassOwnPtr<ScrollingCoordinator> create(Page*);
     ~ScrollingCoordinator();
 
-    void pageDestroyed();
+    static PassOwnPtr<ScrollingCoordinator> create(Page*);
+
+    void willBeDestroyed();
 
     // Return whether this scrolling coordinator handles scrolling for the given frame view.
     bool coordinatesScrollingForFrameView(FrameView*) const;
@@ -63,14 +61,10 @@ public:
     // Called when any frame has done its layout.
     void notifyLayoutUpdated();
 
-    // Should be called after compositing has been updated.
-    void updateAfterCompositingChange();
+    void updateAfterCompositingChangeIfNeeded();
 
-    bool needsToUpdateAfterCompositingChange() const { return m_scrollGestureRegionIsDirty || m_touchEventTargetRectsAreDirty || frameViewIsDirty(); }
-
-    // Should be called whenever a wheel event handler is added or removed in the
-    // frame view's underlying document.
-    void frameViewWheelEventHandlerCountChanged(FrameView*);
+    void updateHaveWheelEventHandlers();
+    void updateHaveScrollEventHandlers();
 
     // Should be called whenever the slow repaint objects counter changes between zero and one.
     void frameViewHasSlowRepaintObjectsDidChange(FrameView*);
@@ -90,12 +84,13 @@ public:
         HasSlowRepaintObjects = 1 << 0,
         HasViewportConstrainedObjectsWithoutSupportingFixedLayers = 1 << 1,
         HasNonLayerViewportConstrainedObjects = 1 << 2,
+        ThreadedScrollingDisabled = 1 << 3
     };
 
     MainThreadScrollingReasons mainThreadScrollingReasons() const;
     bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThreadScrollingReasons() != 0; }
 
-    PassOwnPtr<blink::WebScrollbarLayer> createSolidColorScrollbarLayer(ScrollbarOrientation, int thumbThickness, bool isLeftSideVerticalScrollbar);
+    PassOwnPtr<blink::WebScrollbarLayer> createSolidColorScrollbarLayer(ScrollbarOrientation, int thumbThickness, int trackStart, bool isLeftSideVerticalScrollbar);
 
     void willDestroyScrollableArea(ScrollableArea*);
     // Returns true if the coordinator handled this change.
@@ -123,10 +118,7 @@ protected:
     explicit ScrollingCoordinator(Page*);
 
     bool isForMainFrame(ScrollableArea*) const;
-
-    unsigned computeCurrentWheelEventHandlerCount();
-    GraphicsLayer* scrollLayerForFrameView(FrameView*);
-    GraphicsLayer* counterScrollingLayerForFrameView(FrameView*);
+    bool isForViewport(ScrollableArea*) const;
 
     Page* m_page;
 
@@ -136,16 +128,15 @@ protected:
     bool m_shouldScrollOnMainThreadDirty;
 
 private:
-    void recomputeWheelEventHandlerCountForFrameView(FrameView*);
+    bool shouldUpdateAfterCompositingChange() const { return m_scrollGestureRegionIsDirty || m_touchEventTargetRectsAreDirty || frameViewIsDirty(); }
+
     void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons);
 
     bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const;
 
-    bool touchHitTestingEnabled() const;
     void setShouldHandleScrollGestureOnMainThreadRegion(const Region&);
-    void setTouchEventTargetRects(const LayerHitTestRects&);
+    void setTouchEventTargetRects(LayerHitTestRects&);
     void computeTouchEventTargetRects(LayerHitTestRects&);
-    void setWheelEventHandlerCount(unsigned);
 
     blink::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation, PassOwnPtr<blink::WebScrollbarLayer>);
     blink::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation);
@@ -153,7 +144,7 @@ private:
 
     bool frameViewIsDirty() const;
 
-    typedef HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer> > ScrollbarMap;
+    using ScrollbarMap = HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer>>;
     ScrollbarMap m_horizontalScrollbars;
     ScrollbarMap m_verticalScrollbars;
     HashSet<const RenderLayer*> m_layersWithTouchRects;
@@ -163,6 +154,6 @@ private:
     MainThreadScrollingReasons m_lastMainThreadScrollingReasons;
 };
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // ScrollingCoordinator_h