Chromium Code Reviews| 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; |