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

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 2745783002: Browser plugin should never handle MouseWheels. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index 1380398df26a3ccbd1d165d46a1d68e813558baa..035f37795b07d2852ba31cd0e9fbd4ac2cad6747 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -448,11 +448,15 @@ blink::WebInputEventResult BrowserPlugin::handleInputEvent(
DCHECK(!blink::WebInputEvent::isTouchEventType(event.type()));
- if (event.type() == blink::WebInputEvent::MouseWheel) {
- auto wheel_event = static_cast<const blink::WebMouseWheelEvent&>(event);
- if (wheel_event.resendingPluginId == browser_plugin_instance_id_)
- return blink::WebInputEventResult::NotHandled;
- }
+ // With direct event routing turned on, BrowserPlugin should almost never
+ // see wheel events any more. The two exceptions are (1) scroll bubbling, and
+ // (2) synthetic mouse wheels generated by touchpad GesturePinch events on
+ // Mac, which always go to the mainframe and thus may hit BrowserPlugin if
+ // it's in a top-level embedder. In both cases we should indicate the event
+ // as not handled (for GesturePinch on Mac, indicating the event has been
+ // handled leads to touchpad pinch not working).
+ if (event.type() == blink::WebInputEvent::MouseWheel)
+ return blink::WebInputEventResult::NotHandled;
if (blink::WebInputEvent::isGestureEventType(event.type())) {
auto gesture_event = static_cast<const blink::WebGestureEvent&>(event);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698