| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 RootFrameViewport_h | 5 #ifndef RootFrameViewport_h |
| 6 #define RootFrameViewport_h | 6 #define RootFrameViewport_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/scroll/ScrollableArea.h" | 9 #include "platform/scroll/ScrollableArea.h" |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 GraphicsLayer* layerForContainer() const override; | 61 GraphicsLayer* layerForContainer() const override; |
| 62 GraphicsLayer* layerForScrolling() const override; | 62 GraphicsLayer* layerForScrolling() const override; |
| 63 GraphicsLayer* layerForHorizontalScrollbar() const override; | 63 GraphicsLayer* layerForHorizontalScrollbar() const override; |
| 64 GraphicsLayer* layerForVerticalScrollbar() const override; | 64 GraphicsLayer* layerForVerticalScrollbar() const override; |
| 65 ScrollResultOneDimensional userScroll(ScrollDirectionPhysical, ScrollGranula
rity, float delta = 1) override; | 65 ScrollResultOneDimensional userScroll(ScrollDirectionPhysical, ScrollGranula
rity, float delta = 1) override; |
| 66 bool scrollAnimatorEnabled() const override; | 66 bool scrollAnimatorEnabled() const override; |
| 67 HostWindow* hostWindow() const override; | 67 HostWindow* hostWindow() const override; |
| 68 void serviceScrollAnimations(double) override; | 68 void serviceScrollAnimations(double) override; |
| 69 void updateCompositorScrollAnimations() override; | 69 void updateCompositorScrollAnimations() override; |
| 70 ScrollBehavior scrollBehaviorStyle() const override; | 70 ScrollBehavior scrollBehaviorStyle() const override; |
| 71 // TODO(bokan): This method should be removed. It should be replaced by | |
| 72 // making EventHandler::handleWheelEvent unpack the WheelEvent and make a | |
| 73 // call to this class' scroll method. | |
| 74 ScrollResult handleWheel(const PlatformWheelEvent&) override; | |
| 75 | 71 |
| 76 private: | 72 private: |
| 77 RootFrameViewport(ScrollableArea& visualViewport, ScrollableArea& layoutView
port, bool invertScrollOrder); | 73 RootFrameViewport(ScrollableArea& visualViewport, ScrollableArea& layoutView
port, bool invertScrollOrder); |
| 78 | 74 |
| 79 DoublePoint scrollOffsetFromScrollAnimators() const; | 75 DoublePoint scrollOffsetFromScrollAnimators() const; |
| 80 | 76 |
| 81 // If either of the layout or visual viewports are scrolled explicitly (i.e.
not | 77 // If either of the layout or visual viewports are scrolled explicitly (i.e.
not |
| 82 // through this class), their updated offset will not be reflected in this c
lass' | 78 // through this class), their updated offset will not be reflected in this c
lass' |
| 83 // animator so use this method to pull updated values when necessary. | 79 // animator so use this method to pull updated values when necessary. |
| 84 void updateScrollAnimator(); | 80 void updateScrollAnimator(); |
| 85 | 81 |
| 86 ScrollableArea& visualViewport() const { ASSERT(m_visualViewport); return *m
_visualViewport; } | 82 ScrollableArea& visualViewport() const { ASSERT(m_visualViewport); return *m
_visualViewport; } |
| 87 ScrollableArea& layoutViewport() const { ASSERT(m_layoutViewport); return *m
_layoutViewport; } | 83 ScrollableArea& layoutViewport() const { ASSERT(m_layoutViewport); return *m
_layoutViewport; } |
| 88 | 84 |
| 89 RawPtrWillBeMember<ScrollableArea> m_visualViewport; | 85 RawPtrWillBeMember<ScrollableArea> m_visualViewport; |
| 90 RawPtrWillBeMember<ScrollableArea> m_layoutViewport; | 86 RawPtrWillBeMember<ScrollableArea> m_layoutViewport; |
| 91 | 87 |
| 92 // Experimental flag. If the experiment is enabled, scroll the visual viewpo
rt first, | 88 // Experimental flag. If the experiment is enabled, scroll the visual viewpo
rt first, |
| 93 // the bubble scrolls to the layout viewport. | 89 // the bubble scrolls to the layout viewport. |
| 94 bool m_invertScrollOrder; | 90 bool m_invertScrollOrder; |
| 95 }; | 91 }; |
| 96 | 92 |
| 97 } // namespace blink | 93 } // namespace blink |
| 98 | 94 |
| 99 #endif // RootFrameViewport_h | 95 #endif // RootFrameViewport_h |
| OLD | NEW |