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

Unified Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc

Issue 904553002: Make pinch-zoom work for OOP PDF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 8f10a0be9f6ce20c82d479e82d7e95323bf4f407..b829c9e9106e25e87083267a5e83e98b91816bc4 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -26,6 +26,7 @@
#include "extensions/strings/grit/extensions_strings.h"
#include "ipc/ipc_message_macros.h"
#include "net/base/url_util.h"
+#include "third_party/WebKit/public/web/WebInputEvent.h"
using content::WebContents;
@@ -187,6 +188,19 @@ bool MimeHandlerViewGuest::HandleContextMenu(
return false;
}
+bool MimeHandlerViewGuest::PreHandleGestureEvent(
+ content::WebContents* source,
+ const blink::WebGestureEvent& event) {
+ if (event.type == blink::WebGestureEvent::GesturePinchBegin ||
+ event.type == blink::WebGestureEvent::GesturePinchUpdate ||
+ event.type == blink::WebGestureEvent::GesturePinchEnd) {
+ // If we're an embedded plugin we drop pinch-gestures to avoid zooming the
+ // guest.
+ return !is_full_page_plugin();
+ }
+ return false;
+}
+
void MimeHandlerViewGuest::FindReply(content::WebContents* web_contents,
int request_id,
int number_of_matches,
« no previous file with comments | « extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698