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

Unified Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10987078: Enforce --enable-pinch flag on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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/browser/renderer_host/render_widget_host_view_win.cc
===================================================================
--- content/browser/renderer_host/render_widget_host_view_win.cc (revision 159005)
+++ content/browser/renderer_host/render_widget_host_view_win.cc (working copy)
@@ -380,6 +380,12 @@
DISALLOW_COPY_AND_ASSIGN(TouchEventFromWebTouchPoint);
};
+bool ShouldSendPinchGesture() {
+ static bool pinch_allowed =
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch);
Nico 2012/09/28 04:00:14 nit: HasSwitch() should be fast, no need to make t
+ return pinch_allowed;
+}
+
} // namespace
const wchar_t kRenderWidgetHostHWNDClass[] = L"Chrome_RenderWidgetHostHWND";
@@ -2785,6 +2791,15 @@
if (!render_widget_host_)
return false;
+ // Pinch gestures are disabled by default on windows desktop. See
+ // crbug.com/128477 and crbug.com/148816
+ if ((gesture->type() == ui::ET_GESTURE_PINCH_BEGIN ||
+ gesture->type() == ui::ET_GESTURE_PINCH_UPDATE ||
+ gesture->type() == ui::ET_GESTURE_PINCH_END) &&
+ !ShouldSendPinchGesture()) {
+ return true;
+ }
+
WebKit::WebGestureEvent web_gesture = CreateWebGestureEvent(m_hWnd, *gesture);
if (web_gesture.type == WebKit::WebGestureEvent::Undefined)
return false;
« 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