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

Unified Diff: content/public/browser/web_contents_delegate.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: content/public/browser/web_contents_delegate.cc
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index 63ad65baeabd93980bd423d3078685cb4074f52b..0f7fa48e0f28bd484e597c3b2dd71244679a7a6c 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -11,6 +11,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/bindings_policy.h"
+#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/gfx/rect.h"
namespace content {
@@ -110,6 +111,19 @@ bool WebContentsDelegate::PreHandleKeyboardEvent(
return false;
}
+bool WebContentsDelegate::PreHandleGestureEvent(
+ WebContents* source,
+ const blink::WebGestureEvent& event) {
+#if !defined(OS_ANDROID)
+ // On Desktop, swallow pinch events by default
jam 2014/01/14 17:02:45 why is this logic in this interface? will every co
bokan 2014/01/14 18:49:05 The idea is to disable pinch in all cases except w
jam 2014/01/16 16:42:44 Native looking UI shouldn't be using WebContents,
bokan 2014/01/16 16:49:20 OOBE pages like the login screen, create new user,
jam 2014/01/17 05:49:51 I see. So why not just have those places override
+ return event.type == blink::WebGestureEvent::GesturePinchBegin ||
+ event.type == blink::WebGestureEvent::GesturePinchUpdate ||
+ event.type == blink::WebGestureEvent::GesturePinchEnd;
+#else
+ return false;
+#endif
+}
+
bool WebContentsDelegate::CanDragEnter(
WebContents* source,
const DropData& data,

Powered by Google App Engine
This is Rietveld 408576698