| 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 #include "core/input/ScrollManager.h" | 5 #include "core/input/ScrollManager.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMNodeIds.h" | 7 #include "core/dom/DOMNodeIds.h" |
| 8 #include "core/events/GestureEvent.h" | 8 #include "core/events/GestureEvent.h" |
| 9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| 11 #include "core/frame/TopControls.h" | 11 #include "core/frame/TopControls.h" |
| 12 #include "core/html/HTMLFrameOwnerElement.h" | 12 #include "core/html/HTMLFrameOwnerElement.h" |
| 13 #include "core/input/EventHandler.h" | 13 #include "core/input/EventHandler.h" |
| 14 #include "core/layout/LayoutPart.h" | 14 #include "core/layout/LayoutPart.h" |
| 15 #include "core/loader/DocumentLoader.h" | 15 #include "core/loader/DocumentLoader.h" |
| 16 #include "core/page/AutoscrollController.h" | 16 #include "core/page/AutoscrollController.h" |
| 17 #include "core/page/Page.h" | 17 #include "core/page/Page.h" |
| 18 #include "core/page/scrolling/OverscrollController.h" | 18 #include "core/page/scrolling/OverscrollController.h" |
| 19 #include "core/page/scrolling/RootScrollerController.h" |
| 19 #include "core/page/scrolling/ScrollState.h" | 20 #include "core/page/scrolling/ScrollState.h" |
| 20 #include "core/paint/PaintLayer.h" | 21 #include "core/paint/PaintLayer.h" |
| 21 #include "platform/PlatformGestureEvent.h" | 22 #include "platform/PlatformGestureEvent.h" |
| 22 #include "wtf/PtrUtil.h" | 23 #include "wtf/PtrUtil.h" |
| 23 #include <memory> | 24 #include <memory> |
| 24 | 25 |
| 25 | 26 |
| 26 namespace blink { | 27 namespace blink { |
| 27 | 28 |
| 28 ScrollManager::ScrollManager(LocalFrame* frame) | 29 ScrollManager::ScrollManager(LocalFrame* frame) |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 bool ScrollManager::isEffectiveRootScroller(const Node& node) const | 344 bool ScrollManager::isEffectiveRootScroller(const Node& node) const |
| 344 { | 345 { |
| 345 // The root scroller is the one Element on the page designated to perform | 346 // The root scroller is the one Element on the page designated to perform |
| 346 // "viewport actions" like top controls movement and overscroll glow. | 347 // "viewport actions" like top controls movement and overscroll glow. |
| 347 if (!m_frame->document()) | 348 if (!m_frame->document()) |
| 348 return false; | 349 return false; |
| 349 | 350 |
| 350 if (!node.isElementNode()) | 351 if (!node.isElementNode()) |
| 351 return false; | 352 return false; |
| 352 | 353 |
| 353 return node.isSameNode(m_frame->document()->effectiveRootScroller()); | 354 return node.isSameNode(m_frame->document()->rootScrollerController()->effect
iveRootScroller()); |
| 354 } | 355 } |
| 355 | 356 |
| 356 | 357 |
| 357 WebInputEventResult ScrollManager::handleGestureScrollEvent(const PlatformGestur
eEvent& gestureEvent) | 358 WebInputEventResult ScrollManager::handleGestureScrollEvent(const PlatformGestur
eEvent& gestureEvent) |
| 358 { | 359 { |
| 359 Node* eventTarget = nullptr; | 360 Node* eventTarget = nullptr; |
| 360 Scrollbar* scrollbar = nullptr; | 361 Scrollbar* scrollbar = nullptr; |
| 361 if (gestureEvent.type() != PlatformEvent::GestureScrollBegin) { | 362 if (gestureEvent.type() != PlatformEvent::GestureScrollBegin) { |
| 362 scrollbar = m_scrollbarHandlingScrollGesture.get(); | 363 scrollbar = m_scrollbarHandlingScrollGesture.get(); |
| 363 eventTarget = m_scrollGestureHandlingNode.get(); | 364 eventTarget = m_scrollGestureHandlingNode.get(); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 DEFINE_TRACE(ScrollManager) | 505 DEFINE_TRACE(ScrollManager) |
| 505 { | 506 { |
| 506 visitor->trace(m_frame); | 507 visitor->trace(m_frame); |
| 507 visitor->trace(m_scrollGestureHandlingNode); | 508 visitor->trace(m_scrollGestureHandlingNode); |
| 508 visitor->trace(m_previousGestureScrolledNode); | 509 visitor->trace(m_previousGestureScrolledNode); |
| 509 visitor->trace(m_scrollbarHandlingScrollGesture); | 510 visitor->trace(m_scrollbarHandlingScrollGesture); |
| 510 visitor->trace(m_resizeScrollableArea); | 511 visitor->trace(m_resizeScrollableArea); |
| 511 } | 512 } |
| 512 | 513 |
| 513 } // namespace blink | 514 } // namespace blink |
| OLD | NEW |