Chromium Code Reviews| 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 OverscrollController; | 15 class OverscrollController; |
| 16 class RootViewportScrollCallback; | |
|
tdresser
2016/07/06 18:28:18
Is this used?
bokan
2016/07/06 21:12:04
Nope, removed. As well as OverscrollController and
| |
| 16 class TopControls; | 17 class TopControls; |
| 17 class ViewportScrollCallback; | 18 class ViewportScrollCallback; |
| 18 | 19 |
| 19 // Manages the root scroller associated with a given document. The root scroller | 20 // Manages the root scroller associated with a given document. The root scroller |
| 20 // causes top controls movement, overscroll effects and prevents chaining | 21 // causes top controls movement, overscroll effects and prevents chaining |
| 21 // scrolls up further in the DOM. It can be set from script using | 22 // 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 16 matching lines...) Expand all Loading... | |
| 42 // ViewportScrollCallback can be provided. If it is, RootScrollerController | 43 // ViewportScrollCallback can be provided. If it is, RootScrollerController |
| 43 // will ensure that the effectiveRootScroller element always has this set as | 44 // will ensure that the effectiveRootScroller element always has this set as |
| 44 // the apply scroll callback. | 45 // the apply scroll callback. |
| 45 static RootScrollerController* create( | 46 static RootScrollerController* create( |
| 46 Document& document, | 47 Document& document, |
| 47 ViewportScrollCallback* applyScrollCallback) | 48 ViewportScrollCallback* applyScrollCallback) |
| 48 { | 49 { |
| 49 return new RootScrollerController(document, applyScrollCallback); | 50 return new RootScrollerController(document, applyScrollCallback); |
| 50 } | 51 } |
| 51 | 52 |
| 52 // Creates an apply scroll callback that handles viewport actions like | |
| 53 // TopControls movement and Overscroll. The TopControls and | |
| 54 // OverscrollController are given to the ViewportScrollCallback but are not | |
| 55 // owned or kept alive by it. | |
| 56 static ViewportScrollCallback* createViewportApplyScroll( | |
| 57 TopControls*, OverscrollController*); | |
| 58 | |
| 59 DECLARE_TRACE(); | 53 DECLARE_TRACE(); |
| 60 | 54 |
| 61 // Sets the element that will be used as the root scroller. This can be | 55 // Sets the element that will be used as the root scroller. This can be |
| 62 // nullptr, in which case we'll use the default element (documentElement) as | 56 // nullptr, in which case we'll use the default element (documentElement) as |
| 63 // the effective root scroller. | 57 // the effective root scroller. |
| 64 void set(Element*); | 58 void set(Element*); |
| 65 | 59 |
| 66 // Returns the element currently set as the root scroller from script. This | 60 // Returns the element currently set as the root scroller from script. This |
| 67 // differs from the effective root scroller since the set Element may not | 61 // differs from the effective root scroller since the set Element may not |
| 68 // currently be a valid root scroller. e.g. If the page sets an Element | 62 // currently be a valid root scroller. e.g. If the page sets an Element |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 WeakMember<Document> m_document; | 96 WeakMember<Document> m_document; |
| 103 Member<ViewportScrollCallback> m_viewportApplyScroll; | 97 Member<ViewportScrollCallback> m_viewportApplyScroll; |
| 104 | 98 |
| 105 WeakMember<Element> m_rootScroller; | 99 WeakMember<Element> m_rootScroller; |
| 106 WeakMember<Element> m_effectiveRootScroller; | 100 WeakMember<Element> m_effectiveRootScroller; |
| 107 }; | 101 }; |
| 108 | 102 |
| 109 } // namespace blink | 103 } // namespace blink |
| 110 | 104 |
| 111 #endif // RootScrollerController_h | 105 #endif // RootScrollerController_h |
| OLD | NEW |