| 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 RootScrollerController_h | 5 #ifndef RootScrollerController_h |
| 6 #define RootScrollerController_h | 6 #define RootScrollerController_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class Document; | 13 class Document; |
| 14 class Element; | 14 class Element; |
| 15 class GraphicsLayer; | 15 class GraphicsLayer; |
| 16 class PaintLayer; |
| 16 class ScrollableArea; | 17 class ScrollableArea; |
| 17 class ScrollStateCallback; | 18 class ScrollStateCallback; |
| 18 | 19 |
| 19 // Manages the root scroller associated with a given document. The root | 20 // Manages the root scroller associated with a given document. The root |
| 20 // scroller causes top controls movement, overscroll effects and prevents | 21 // scroller causes top controls movement, overscroll effects and prevents |
| 21 // chaining scrolls up further in the DOM. It can be set from script using | 22 // chaining scrolls up further in the DOM. It can be set from script using |
| 22 // document.setRootScroller. | 23 // document.setRootScroller. |
| 23 // | 24 // |
| 24 // There are two notions of a root scroller in this class: m_rootScroller and | 25 // There are two notions of a root scroller in this class: m_rootScroller and |
| 25 // m_effectiveRootScroller. The former is the Element that was set as the root | 26 // m_effectiveRootScroller. The former is the Element that was set as the root |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // element. | 83 // element. |
| 83 virtual GraphicsLayer* rootScrollerLayer(); | 84 virtual GraphicsLayer* rootScrollerLayer(); |
| 84 | 85 |
| 85 // Returns true if the given ScrollStateCallback is the | 86 // Returns true if the given ScrollStateCallback is the |
| 86 // ViewportScrollCallback managed by this class. | 87 // ViewportScrollCallback managed by this class. |
| 87 // TODO(bokan): Temporarily needed to allow ScrollCustomization to | 88 // TODO(bokan): Temporarily needed to allow ScrollCustomization to |
| 88 // differentiate between real custom callback and the built-in viewport | 89 // differentiate between real custom callback and the built-in viewport |
| 89 // apply scroll. crbug.com/623079. | 90 // apply scroll. crbug.com/623079. |
| 90 virtual bool isViewportScrollCallback(const ScrollStateCallback*) const; | 91 virtual bool isViewportScrollCallback(const ScrollStateCallback*) const; |
| 91 | 92 |
| 93 PaintLayer* rootScrollerPaintLayer() const; |
| 94 |
| 92 protected: | 95 protected: |
| 93 RootScrollerController(Document&); | 96 RootScrollerController(Document&); |
| 94 | 97 |
| 95 // Called when the root scroller of any descendant frames changes. This | 98 // Called when the root scroller of any descendant frames changes. This |
| 96 // will only ever be called on the top document's RootScrollerController. | 99 // will only ever be called on the top document's RootScrollerController. |
| 97 virtual void globalRootScrollerMayHaveChanged(); | 100 virtual void globalRootScrollerMayHaveChanged(); |
| 98 | 101 |
| 99 // Returns the ScrollableArea to use to scroll the given Element. | 102 // Returns the ScrollableArea to use to scroll the given Element. |
| 100 ScrollableArea* scrollableAreaFor(const Element&) const; | 103 ScrollableArea* scrollableAreaFor(const Element&) const; |
| 101 | 104 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 124 | 127 |
| 125 // The element currently being used as the root scroller in this Document. | 128 // The element currently being used as the root scroller in this Document. |
| 126 // If the m_rootScroller is valid this will point to it. Otherwise, it'll | 129 // If the m_rootScroller is valid this will point to it. Otherwise, it'll |
| 127 // use a default Element. | 130 // use a default Element. |
| 128 WeakMember<Element> m_effectiveRootScroller; | 131 WeakMember<Element> m_effectiveRootScroller; |
| 129 }; | 132 }; |
| 130 | 133 |
| 131 } // namespace blink | 134 } // namespace blink |
| 132 | 135 |
| 133 #endif // RootScrollerController_h | 136 #endif // RootScrollerController_h |
| OLD | NEW |