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 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 // This returns the Element that's actually being used to control viewport | 74 // This returns the Element that's actually being used to control viewport |
| 75 // actions right now. This is different from get() if a root scroller hasn't | 75 // actions right now. This is different from get() if a root scroller hasn't |
| 76 // been set, or if the set root scroller isn't currently a valid scroller. | 76 // been set, or if the set root scroller isn't currently a valid scroller. |
| 77 Element* effectiveRootScroller() const; | 77 Element* effectiveRootScroller() const; |
| 78 | 78 |
| 79 // This class needs to be informed of changes in layout so that it can | 79 // This class needs to be informed of changes in layout so that it can |
| 80 // determine if the current root scroller is still valid or if it must be | 80 // determine if the current root scroller is still valid or if it must be |
| 81 // replaced by the defualt root scroller. | 81 // replaced by the defualt root scroller. |
| 82 void didUpdateLayout(); | 82 void didUpdateLayout(); |
| 83 | 83 |
| 84 // This class needs to be informed of changes to compositing so that it can | |
| 85 // update the compositor when the effective root scroller changes. | |
| 86 void didUpdateCompositing(); | |
| 87 | |
| 84 // TODO(bokan): Temporarily exposed to allow ScrollCustomization to | 88 // TODO(bokan): Temporarily exposed to allow ScrollCustomization to |
| 85 // differentiate between real custom callback and the built-in viewport | 89 // differentiate between real custom callback and the built-in viewport |
| 86 // apply scroll. | 90 // apply scroll. |
| 87 const ViewportScrollCallback* viewportScrollCallback() | 91 const ViewportScrollCallback* viewportScrollCallback() |
| 88 { | 92 { |
| 89 return m_viewportApplyScroll; | 93 return m_viewportApplyScroll; |
| 90 } | 94 } |
| 91 | 95 |
| 92 private: | 96 private: |
| 93 RootScrollerController(Document&, ViewportScrollCallback*); | 97 RootScrollerController(Document&, ViewportScrollCallback*); |
| 94 | 98 |
| 95 Element* defaultEffectiveRootScroller(); | 99 Element* defaultEffectiveRootScroller(); |
| 96 | 100 |
| 97 // Ensures the effective root scroller is currently valid and replaces it | 101 // Ensures the effective root scroller is currently valid and replaces it |
| 98 // with the default if not. | 102 // with the default if not. |
| 99 void updateEffectiveRootScroller(); | 103 void updateEffectiveRootScroller(); |
| 100 void moveViewportApplyScroll(Element* target); | 104 void moveViewportApplyScroll(Element* target); |
| 101 | 105 |
| 102 WeakMember<Document> m_document; | 106 WeakMember<Document> m_document; |
| 103 Member<ViewportScrollCallback> m_viewportApplyScroll; | 107 Member<ViewportScrollCallback> m_viewportApplyScroll; |
| 104 | 108 |
| 105 WeakMember<Element> m_rootScroller; | 109 WeakMember<Element> m_rootScroller; |
| 106 WeakMember<Element> m_effectiveRootScroller; | 110 WeakMember<Element> m_effectiveRootScroller; |
| 111 | |
| 112 // Keeps track of whether we need to notify the compositor about a changed | |
| 113 // effective root scroller. This can only be done after a compositing update | |
| 114 // once the layer tree has been updated. | |
| 115 bool m_changedSinceLastCompositingUpdate; | |
|
aelias_OOO_until_Jul13
2016/06/29 22:44:08
I doubt that this dirty bit is really needed. Can
bokan
2016/07/07 21:20:45
Done.
| |
| 107 }; | 116 }; |
| 108 | 117 |
| 109 } // namespace blink | 118 } // namespace blink |
| 110 | 119 |
| 111 #endif // RootScrollerController_h | 120 #endif // RootScrollerController_h |
| OLD | NEW |