Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: third_party/WebKit/Source/core/input/MouseEventManager.cpp

Issue 2918053002: Move middle-click autoscroll to synthetic fling. (Closed)
Patch Set: Delete redundant cursor shape print Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/input/MouseEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
index 5fb02cece231e31f7bf5367553e675e743728925..2a74e8db5d05c76d0405f811a05e4abd50c8c5c3 100644
--- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -91,8 +91,8 @@ void MouseEventManager::Clear() {
mouse_down_may_start_drag_ = false;
captures_dragging_ = false;
is_mouse_position_unknown_ = true;
- last_known_mouse_position_ = IntPoint();
- last_known_mouse_global_position_ = IntPoint();
+ last_known_mouse_position_ = FloatPoint();
+ last_known_mouse_global_position_ = FloatPoint();
mouse_pressed_ = false;
click_count_ = 0;
click_element_ = nullptr;
@@ -567,14 +567,17 @@ bool MouseEventManager::IsMousePositionUnknown() {
}
IntPoint MouseEventManager::LastKnownMousePosition() {
- return last_known_mouse_position_;
+ return FlooredIntPoint(last_known_mouse_position_);
+}
+
+FloatPoint MouseEventManager::LastKnownMousePositionGlobal() {
+ return last_known_mouse_global_position_;
}
void MouseEventManager::SetLastKnownMousePosition(const WebMouseEvent& event) {
is_mouse_position_unknown_ = false;
- last_known_mouse_position_ = FlooredIntPoint(event.PositionInRootFrame());
- last_known_mouse_global_position_ =
- IntPoint(event.PositionInScreen().x, event.PositionInScreen().y);
+ last_known_mouse_position_ = event.PositionInRootFrame();
+ last_known_mouse_global_position_ = event.PositionInScreen();
}
void MouseEventManager::DispatchFakeMouseMoveEventSoon() {
@@ -668,7 +671,7 @@ WebInputEventResult MouseEventManager::HandleMousePressEvent(
WebInputEventResult MouseEventManager::HandleMouseReleaseEvent(
const MouseEventWithHitTestResults& event) {
AutoscrollController* controller = scroll_manager_->GetAutoscrollController();
- if (controller && controller->AutoscrollInProgress())
+ if (controller && controller->SelectionAutoscrollInProgress())
scroll_manager_->StopAutoscroll();
return frame_->GetEventHandler()
@@ -682,7 +685,7 @@ void MouseEventManager::UpdateSelectionForMouseDrag() {
frame_->GetEventHandler()
.GetSelectionController()
.UpdateSelectionForMouseDrag(mouse_press_node_, drag_start_pos_,
- last_known_mouse_position_);
+ FlooredIntPoint(last_known_mouse_position_));
}
bool MouseEventManager::HandleDragDropIfPossible(
@@ -781,7 +784,7 @@ WebInputEventResult MouseEventManager::HandleMouseDraggedEvent(
frame_->GetEventHandler().GetSelectionController().HandleMouseDraggedEvent(
event, mouse_down_pos_, drag_start_pos_, mouse_press_node_.Get(),
- last_known_mouse_position_);
+ FlooredIntPoint(last_known_mouse_position_));
// The call into HandleMouseDraggedEvent may have caused a re-layout,
// so get the LayoutObject again.
« no previous file with comments | « third_party/WebKit/Source/core/input/MouseEventManager.h ('k') | third_party/WebKit/Source/core/input/ScrollManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698