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

Side by Side Diff: extensions/browser/app_window/app_web_contents_helper.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/app_window/app_web_contents_helper.h" 5 #include "extensions/browser/app_window/app_web_contents_helper.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "content/public/browser/native_web_keyboard_event.h" 8 #include "content/public/browser/native_web_keyboard_event.h"
9 #include "content/public/browser/page_navigator.h" 9 #include "content/public/browser/page_navigator.h"
10 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
(...skipping 15 matching lines...) Expand all
26 : browser_context_(browser_context), 26 : browser_context_(browser_context),
27 extension_id_(extension_id), 27 extension_id_(extension_id),
28 web_contents_(web_contents), 28 web_contents_(web_contents),
29 app_delegate_(app_delegate) { 29 app_delegate_(app_delegate) {
30 } 30 }
31 31
32 // static 32 // static
33 bool AppWebContentsHelper::ShouldSuppressGestureEvent( 33 bool AppWebContentsHelper::ShouldSuppressGestureEvent(
34 const blink::WebGestureEvent& event) { 34 const blink::WebGestureEvent& event) {
35 // Disable pinch zooming in app windows. 35 // Disable pinch zooming in app windows.
36 return event.type == blink::WebGestureEvent::GesturePinchBegin || 36 return event.type() == blink::WebGestureEvent::GesturePinchBegin ||
37 event.type == blink::WebGestureEvent::GesturePinchUpdate || 37 event.type() == blink::WebGestureEvent::GesturePinchUpdate ||
38 event.type == blink::WebGestureEvent::GesturePinchEnd; 38 event.type() == blink::WebGestureEvent::GesturePinchEnd;
39 } 39 }
40 40
41 content::WebContents* AppWebContentsHelper::OpenURLFromTab( 41 content::WebContents* AppWebContentsHelper::OpenURLFromTab(
42 const content::OpenURLParams& params) const { 42 const content::OpenURLParams& params) const {
43 // Don't allow the current tab to be navigated. It would be nice to map all 43 // Don't allow the current tab to be navigated. It would be nice to map all
44 // anchor tags (even those without target="_blank") to new tabs, but right 44 // anchor tags (even those without target="_blank") to new tabs, but right
45 // now we can't distinguish between those and <meta> refreshes or window.href 45 // now we can't distinguish between those and <meta> refreshes or window.href
46 // navigations, which we don't want to allow. 46 // navigations, which we don't want to allow.
47 // TOOD(mihaip): Can we check for user gestures instead? 47 // TOOD(mihaip): Can we check for user gestures instead?
48 WindowOpenDisposition disposition = params.disposition; 48 WindowOpenDisposition disposition = params.disposition;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 web_contents_, security_origin, type, extension); 106 web_contents_, security_origin, type, extension);
107 } 107 }
108 108
109 const Extension* AppWebContentsHelper::GetExtension() const { 109 const Extension* AppWebContentsHelper::GetExtension() const {
110 return ExtensionRegistry::Get(browser_context_) 110 return ExtensionRegistry::Get(browser_context_)
111 ->enabled_extensions() 111 ->enabled_extensions()
112 .GetByID(extension_id_); 112 .GetByID(extension_id_);
113 } 113 }
114 114
115 } // namespace extensions 115 } // namespace extensions
OLDNEW
« no previous file with comments | « content/renderer/render_widget_unittest.cc ('k') | extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698