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/geometry/IntSize.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 class Element; | 15 class Element; |
15 class FrameHost; | 16 class FrameHost; |
16 class GraphicsLayer; | 17 class GraphicsLayer; |
17 class PaintLayer; | 18 class PaintLayer; |
18 class RootFrameViewport; | 19 class RootFrameViewport; |
19 class ScrollStateCallback; | 20 class ScrollStateCallback; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 PaintLayer* rootScrollerPaintLayer() const; | 60 PaintLayer* rootScrollerPaintLayer() const; |
60 | 61 |
61 // Returns the Element that's the global root scroller. | 62 // Returns the Element that's the global root scroller. |
62 Element* globalRootScroller() const; | 63 Element* globalRootScroller() const; |
63 | 64 |
64 // Called when the root scroller in any frames on the page has changed. | 65 // Called when the root scroller in any frames on the page has changed. |
65 void didChangeRootScroller(); | 66 void didChangeRootScroller(); |
66 | 67 |
67 void mainFrameViewResized(); | 68 void mainFrameViewResized(); |
68 | 69 |
| 70 // Returns the ScrollableArea associated with the globalRootScroller(). Note, |
| 71 // this isn't necessarily the PLSA belonging to the root scroller Element's |
| 72 // LayoutBox. If the root scroller is the documentElement then we use the |
| 73 // FrameView (or LayoutView if root-layer-scrolls). |
| 74 ScrollableArea* rootScrollerArea() const; |
| 75 |
| 76 // Returns the size we should use for the root scroller, accounting for top |
| 77 // controls adjustment and using the root FrameView. |
| 78 IntSize rootScrollerVisibleArea() const; |
| 79 |
69 private: | 80 private: |
70 TopDocumentRootScrollerController(FrameHost&); | 81 TopDocumentRootScrollerController(FrameHost&); |
71 | 82 |
72 // Calculates the Element that should be the globalRootScroller. On a | 83 // Calculates the Element that should be the globalRootScroller. On a |
73 // simple page, this will simply the root frame's effectiveRootScroller but | 84 // simple page, this will simply the root frame's effectiveRootScroller but |
74 // if the root scroller is set to an iframe, this will then descend into | 85 // if the root scroller is set to an iframe, this will then descend into |
75 // the iframe to find its effective root scroller. | 86 // the iframe to find its effective root scroller. |
76 Element* findGlobalRootScrollerElement(); | 87 Element* findGlobalRootScrollerElement(); |
77 | 88 |
78 // Should be called to ensure the correct element is currently set as the | 89 // Should be called to ensure the correct element is currently set as the |
(...skipping 15 matching lines...) Expand all Loading... |
94 // m_viewportApplyScroll has been created, it will always be set on this | 105 // m_viewportApplyScroll has been created, it will always be set on this |
95 // Element. | 106 // Element. |
96 WeakMember<Element> m_globalRootScroller; | 107 WeakMember<Element> m_globalRootScroller; |
97 | 108 |
98 WeakMember<FrameHost> m_frameHost; | 109 WeakMember<FrameHost> m_frameHost; |
99 }; | 110 }; |
100 | 111 |
101 } // namespace blink | 112 } // namespace blink |
102 | 113 |
103 #endif // RootScrollerController_h | 114 #endif // RootScrollerController_h |
OLD | NEW |