| 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" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // ViewportScrollCallback managed by this class. | 46 // ViewportScrollCallback managed by this class. |
| 47 // TODO(bokan): Temporarily needed to allow ScrollCustomization to | 47 // TODO(bokan): Temporarily needed to allow ScrollCustomization to |
| 48 // differentiate between real custom callback and the built-in viewport | 48 // differentiate between real custom callback and the built-in viewport |
| 49 // apply scroll. crbug.com/623079. | 49 // apply scroll. crbug.com/623079. |
| 50 bool isViewportScrollCallback( | 50 bool isViewportScrollCallback( |
| 51 const ScrollStateCallback*) const override; | 51 const ScrollStateCallback*) const override; |
| 52 | 52 |
| 53 // Returns the GraphicsLayer for the global root scroller. | 53 // Returns the GraphicsLayer for the global root scroller. |
| 54 GraphicsLayer* rootScrollerLayer() override; | 54 GraphicsLayer* rootScrollerLayer() override; |
| 55 | 55 |
| 56 // Returns the Element that's the global root scroller. |
| 57 Element* globalRootScroller() const; |
| 58 |
| 56 protected: | 59 protected: |
| 57 TopDocumentRootScrollerController(Document&); | 60 TopDocumentRootScrollerController(Document&); |
| 58 | 61 |
| 59 // Called when the root scroller of descendant frames changes. | 62 // Called when the root scroller of descendant frames changes. |
| 60 void globalRootScrollerMayHaveChanged() override; | 63 void globalRootScrollerMayHaveChanged() override; |
| 61 | 64 |
| 62 private: | 65 private: |
| 63 // Calculates the Element that should be the globalRootScroller. On a | 66 // Calculates the Element that should be the globalRootScroller. On a |
| 64 // simple page, this will simply the root frame's effectiveRootScroller but | 67 // simple page, this will simply the root frame's effectiveRootScroller but |
| 65 // if the root scroller is set to an iframe, this will then descend into | 68 // if the root scroller is set to an iframe, this will then descend into |
| 66 // the iframe to find its effective root scroller. | 69 // the iframe to find its effective root scroller. |
| 67 Element* findGlobalRootScrollerElement(); | 70 Element* findGlobalRootScrollerElement(); |
| 68 | 71 |
| 69 // Should be called to recalculate the global root scroller and ensure all | 72 // Should be called to recalculate the global root scroller and ensure all |
| 70 // appropriate state changes are made if it changes. | 73 // appropriate state changes are made if it changes. |
| 71 void updateGlobalRootScroller(); | 74 void updateGlobalRootScroller(); |
| 72 | 75 |
| 76 void setNeedsCompositingInputsUpdateOnGlobalRootScroller(); |
| 77 |
| 73 // The apply-scroll callback that moves top controls and produces | 78 // The apply-scroll callback that moves top controls and produces |
| 74 // overscroll effects. This class makes sure this callback is set on the | 79 // overscroll effects. This class makes sure this callback is set on the |
| 75 // appropriate root scroller element. | 80 // appropriate root scroller element. |
| 76 Member<ViewportScrollCallback> m_viewportApplyScroll; | 81 Member<ViewportScrollCallback> m_viewportApplyScroll; |
| 77 | 82 |
| 78 // The page level root scroller. i.e. The actual element for which scrolling | 83 // The page level root scroller. i.e. The actual element for which scrolling |
| 79 // should move top controls and produce overscroll glow. | 84 // should move top controls and produce overscroll glow. |
| 80 WeakMember<Element> m_globalRootScroller; | 85 WeakMember<Element> m_globalRootScroller; |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 } // namespace blink | 88 } // namespace blink |
| 84 | 89 |
| 85 #endif // RootScrollerController_h | 90 #endif // RootScrollerController_h |
| OLD | NEW |