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

Unified Diff: third_party/WebKit/Source/core/page/AutoscrollController.cpp

Issue 2961003002: Prevent plugins from changing mouse cursor during middle-click autoscroll. (Closed)
Patch Set: Rebase 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
« no previous file with comments | « third_party/WebKit/Source/core/exported/WebViewTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/AutoscrollController.cpp
diff --git a/third_party/WebKit/Source/core/page/AutoscrollController.cpp b/third_party/WebKit/Source/core/page/AutoscrollController.cpp
index 1829f5d1c01951a5ae562e1350586286db28ca21..0a17c9a5c6baab349d57e904f9d2cad7d3bd4086 100644
--- a/third_party/WebKit/Source/core/page/AutoscrollController.cpp
+++ b/third_party/WebKit/Source/core/page/AutoscrollController.cpp
@@ -238,7 +238,9 @@ void AutoscrollController::HandleMouseMoveForMiddleClickAutoscroll(
last_velocity_ = velocity;
if (middle_click_mode_ == kMiddleClickInitial)
middle_click_mode_ = kMiddleClickHolding;
+ page_->GetChromeClient().SetCursorOverridden(false);
view->SetCursor(MiddleClickAutoscrollCursor(velocity));
+ page_->GetChromeClient().SetCursorOverridden(true);
page_->GetChromeClient().AutoscrollFling(velocity, frame);
}
}
@@ -265,6 +267,7 @@ void AutoscrollController::StopMiddleClickAutoscroll(LocalFrame* frame) {
page_->GetChromeClient().AutoscrollEnd(frame);
autoscroll_type_ = kNoAutoscroll;
+ page_->GetChromeClient().SetCursorOverridden(false);
frame->LocalFrameRoot().GetEventHandler().ScheduleCursorUpdate();
}
@@ -289,8 +292,10 @@ void AutoscrollController::StartMiddleClickAutoscroll(
UseCounter::Count(frame, WebFeature::kMiddleClickAutoscrollStart);
last_velocity_ = FloatSize();
+
if (LocalFrameView* view = frame->View())
view->SetCursor(MiddleClickAutoscrollCursor(last_velocity_));
+ page_->GetChromeClient().SetCursorOverridden(true);
page_->GetChromeClient().AutoscrollStart(
position.ScaledBy(1 / frame->DevicePixelRatio()), frame);
}
« no previous file with comments | « third_party/WebKit/Source/core/exported/WebViewTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698