| 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/BrowserControls.h" | 9 #include "core/frame/BrowserControls.h" |
| 10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 return false; | 502 return false; |
| 503 } | 503 } |
| 504 | 504 |
| 505 bool ScrollManager::inResizeMode() const { | 505 bool ScrollManager::inResizeMode() const { |
| 506 return m_resizeScrollableArea && m_resizeScrollableArea->inResizeMode(); | 506 return m_resizeScrollableArea && m_resizeScrollableArea->inResizeMode(); |
| 507 } | 507 } |
| 508 | 508 |
| 509 void ScrollManager::resize(const PlatformMouseEvent& evt) { | 509 void ScrollManager::resize(const WebMouseEvent& evt) { |
| 510 if (evt.type() == PlatformEvent::MouseMoved) { | 510 if (evt.type() == WebInputEvent::MouseMove) { |
| 511 if (!m_frame->eventHandler().mousePressed()) | 511 if (!m_frame->eventHandler().mousePressed()) |
| 512 return; | 512 return; |
| 513 m_resizeScrollableArea->resize(evt.position(), m_offsetFromResizeCorner); | 513 m_resizeScrollableArea->resize(flooredIntPoint(evt.positionInRootFrame()), |
| 514 m_offsetFromResizeCorner); |
| 514 } | 515 } |
| 515 } | 516 } |
| 516 | 517 |
| 517 void ScrollManager::clearResizeScrollableArea(bool shouldNotBeNull) { | 518 void ScrollManager::clearResizeScrollableArea(bool shouldNotBeNull) { |
| 518 if (shouldNotBeNull) | 519 if (shouldNotBeNull) |
| 519 DCHECK(m_resizeScrollableArea); | 520 DCHECK(m_resizeScrollableArea); |
| 520 | 521 |
| 521 if (m_resizeScrollableArea) | 522 if (m_resizeScrollableArea) |
| 522 m_resizeScrollableArea->setInResizeMode(false); | 523 m_resizeScrollableArea->setInResizeMode(false); |
| 523 m_resizeScrollableArea = nullptr; | 524 m_resizeScrollableArea = nullptr; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 539 if (scrollbar->gestureEvent(targetedEvent.event(), &shouldUpdateCapture)) { | 540 if (scrollbar->gestureEvent(targetedEvent.event(), &shouldUpdateCapture)) { |
| 540 if (shouldUpdateCapture) | 541 if (shouldUpdateCapture) |
| 541 m_scrollbarHandlingScrollGesture = scrollbar; | 542 m_scrollbarHandlingScrollGesture = scrollbar; |
| 542 return true; | 543 return true; |
| 543 } | 544 } |
| 544 } | 545 } |
| 545 return false; | 546 return false; |
| 546 } | 547 } |
| 547 | 548 |
| 548 } // namespace blink | 549 } // namespace blink |
| OLD | NEW |