OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TopDocumentRootScrollerController_h | 5 #ifndef TopDocumentRootScrollerController_h |
6 #define TopDocumentRootScrollerController_h | 6 #define TopDocumentRootScrollerController_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/page/scrolling/RootScrollerController.h" | 9 #include "core/page/scrolling/RootScrollerController.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class Element; | 14 class Element; |
15 class FrameHost; | 15 class FrameHost; |
16 class GraphicsLayer; | 16 class GraphicsLayer; |
17 class RootFrameViewport; | 17 class RootFrameViewport; |
18 class ScrollStateCallback; | 18 class ScrollStateCallback; |
19 class ViewportScrollCallback; | 19 class ViewportScrollCallback; |
20 | 20 |
21 // This class manages the the page level aspects of the root scroller. That | 21 // This class manages the the page level aspects of the root scroller. That |
22 // is, given all the iframes on a page and their individual root scrollers, | 22 // is, given all the iframes on a page and their individual root scrollers, |
23 // this class will determine which ultimate Element should be used as the root | 23 // this class will determine which ultimate Element should be used as the root |
24 // scroller and ensures that Element is used to scroll top controls and provide | 24 // scroller and ensures that Element is used to scroll browser controls and |
25 // overscroll effects. | 25 // provide overscroll effects. |
26 // TODO(bokan): This class is currently OOPIF unaware. crbug.com/642378. | 26 // TODO(bokan): This class is currently OOPIF unaware. crbug.com/642378. |
27 class CORE_EXPORT TopDocumentRootScrollerController | 27 class CORE_EXPORT TopDocumentRootScrollerController |
28 : public GarbageCollected<TopDocumentRootScrollerController> { | 28 : public GarbageCollected<TopDocumentRootScrollerController> { |
29 public: | 29 public: |
30 static TopDocumentRootScrollerController* create(FrameHost&); | 30 static TopDocumentRootScrollerController* create(FrameHost&); |
31 | 31 |
32 DECLARE_TRACE(); | 32 DECLARE_TRACE(); |
33 | 33 |
34 // This class needs to be informed of changes to compositing so that it can | 34 // This class needs to be informed of changes to compositing so that it can |
35 // update the compositor when the effective root scroller changes. | 35 // update the compositor when the effective root scroller changes. |
36 void didUpdateCompositing(); | 36 void didUpdateCompositing(); |
37 | 37 |
38 // This method needs to be called to create a ViewportScrollCallback that | 38 // This method needs to be called to create a ViewportScrollCallback that |
39 // will be used to apply viewport scrolling actions like top controls | 39 // will be used to apply viewport scrolling actions like browser controls |
40 // movement and overscroll glow. | 40 // movement and overscroll glow. |
41 void initializeViewportScrollCallback(RootFrameViewport&); | 41 void initializeViewportScrollCallback(RootFrameViewport&); |
42 | 42 |
43 // Returns true if the given ScrollStateCallback is the | 43 // Returns true if the given ScrollStateCallback is the |
44 // ViewportScrollCallback managed by this class. | 44 // ViewportScrollCallback managed by this class. |
45 // TODO(bokan): Temporarily needed to allow ScrollCustomization to | 45 // TODO(bokan): Temporarily needed to allow ScrollCustomization to |
46 // differentiate between real custom callback and the built-in viewport | 46 // differentiate between real custom callback and the built-in viewport |
47 // apply scroll. crbug.com/623079. | 47 // apply scroll. crbug.com/623079. |
48 bool isViewportScrollCallback(const ScrollStateCallback*) const; | 48 bool isViewportScrollCallback(const ScrollStateCallback*) const; |
49 | 49 |
(...skipping 17 matching lines...) Expand all Loading... |
67 | 67 |
68 // Should be called to ensure the correct element is currently set as the | 68 // Should be called to ensure the correct element is currently set as the |
69 // global root scroller and that all appropriate state changes are made if | 69 // global root scroller and that all appropriate state changes are made if |
70 // it changes. | 70 // it changes. |
71 void recomputeGlobalRootScroller(); | 71 void recomputeGlobalRootScroller(); |
72 | 72 |
73 Document* topDocument() const; | 73 Document* topDocument() const; |
74 | 74 |
75 void setNeedsCompositingInputsUpdateOnGlobalRootScroller(); | 75 void setNeedsCompositingInputsUpdateOnGlobalRootScroller(); |
76 | 76 |
77 // The apply-scroll callback that moves top controls and produces | 77 // The apply-scroll callback that moves browser controls and produces |
78 // overscroll effects. This class makes sure this callback is set on the | 78 // overscroll effects. This class makes sure this callback is set on the |
79 // appropriate root scroller element. | 79 // appropriate root scroller element. |
80 Member<ViewportScrollCallback> m_viewportApplyScroll; | 80 Member<ViewportScrollCallback> m_viewportApplyScroll; |
81 | 81 |
82 // The page level root scroller. i.e. The actual element for which | 82 // The page level root scroller. i.e. The actual element for which |
83 // scrolling should move top controls and produce overscroll glow. Once an | 83 // scrolling should move browser controls and produce overscroll glow. Once an |
84 // m_viewportApplyScroll has been created, it will always be set on this | 84 // m_viewportApplyScroll has been created, it will always be set on this |
85 // Element. | 85 // Element. |
86 WeakMember<Element> m_globalRootScroller; | 86 WeakMember<Element> m_globalRootScroller; |
87 | 87 |
88 WeakMember<FrameHost> m_frameHost; | 88 WeakMember<FrameHost> m_frameHost; |
89 }; | 89 }; |
90 | 90 |
91 } // namespace blink | 91 } // namespace blink |
92 | 92 |
93 #endif // RootScrollerController_h | 93 #endif // RootScrollerController_h |
OLD | NEW |