| 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 <memory> | 7 #include <memory> |
| 8 #include "core/dom/DOMNodeIds.h" | 8 #include "core/dom/DOMNodeIds.h" |
| 9 #include "core/events/GestureEvent.h" | 9 #include "core/events/GestureEvent.h" |
| 10 #include "core/frame/BrowserControls.h" | 10 #include "core/frame/BrowserControls.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 bool reset_y = true; | 60 bool reset_y = true; |
| 61 page->GetOverscrollController().ResetAccumulated(reset_x, reset_y); | 61 page->GetOverscrollController().ResetAccumulated(reset_x, reset_y); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 void ScrollManager::StopAutoscroll() { | 65 void ScrollManager::StopAutoscroll() { |
| 66 if (AutoscrollController* controller = GetAutoscrollController()) | 66 if (AutoscrollController* controller = GetAutoscrollController()) |
| 67 controller->StopAutoscroll(); | 67 controller->StopAutoscroll(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void ScrollManager::StopMiddleClickAutoscroll() { |
| 71 if (AutoscrollController* controller = GetAutoscrollController()) |
| 72 controller->StopMiddleClickAutoscroll(frame_); |
| 73 } |
| 74 |
| 70 bool ScrollManager::MiddleClickAutoscrollInProgress() const { | 75 bool ScrollManager::MiddleClickAutoscrollInProgress() const { |
| 71 return GetAutoscrollController() && | 76 return GetAutoscrollController() && |
| 72 GetAutoscrollController()->MiddleClickAutoscrollInProgress(); | 77 GetAutoscrollController()->MiddleClickAutoscrollInProgress(); |
| 73 } | 78 } |
| 74 | 79 |
| 75 AutoscrollController* ScrollManager::GetAutoscrollController() const { | 80 AutoscrollController* ScrollManager::GetAutoscrollController() const { |
| 76 if (Page* page = frame_->GetPage()) | 81 if (Page* page = frame_->GetPage()) |
| 77 return &page->GetAutoscrollController(); | 82 return &page->GetAutoscrollController(); |
| 78 return nullptr; | 83 return nullptr; |
| 79 } | 84 } |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 &should_update_capture)) { | 661 &should_update_capture)) { |
| 657 if (should_update_capture) | 662 if (should_update_capture) |
| 658 scrollbar_handling_scroll_gesture_ = scrollbar; | 663 scrollbar_handling_scroll_gesture_ = scrollbar; |
| 659 return true; | 664 return true; |
| 660 } | 665 } |
| 661 } | 666 } |
| 662 return false; | 667 return false; |
| 663 } | 668 } |
| 664 | 669 |
| 665 } // namespace blink | 670 } // namespace blink |
| OLD | NEW |