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

Unified Diff: ui/views/controls/webview/webview.cc

Issue 134683004: Disabled pinch zooming in non-browser Aura windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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: ui/views/controls/webview/webview.cc
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
index 0a7734e0656b79569b1c36764fb1005dcd9f9175..151aeb92d5148f1abf75762920e4f17dd5256816 100644
--- a/ui/views/controls/webview/webview.cc
+++ b/ui/views/controls/webview/webview.cc
@@ -12,6 +12,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "ipc/ipc_message.h"
+#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/base/accessibility/accessibility_types.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/events/event.h"
@@ -191,6 +192,15 @@ bool WebView::EmbedsFullscreenWidget() const {
return embed_fullscreen_widget_mode_enabled_;
}
+bool WebView::PreHandleGestureEvent(
+ content::WebContents* source,
+ const blink::WebGestureEvent& event) {
+ // Disable pinch zooming.
+ return event.type == blink::WebGestureEvent::GesturePinchBegin ||
+ event.type == blink::WebGestureEvent::GesturePinchUpdate ||
+ event.type == blink::WebGestureEvent::GesturePinchEnd;
+}
+
////////////////////////////////////////////////////////////////////////////////
// WebView, content::WebContentsObserver implementation:

Powered by Google App Engine
This is Rietveld 408576698