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

Side by Side 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 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/guest_view/mime_handler_view/mime_handler_view_gues t.h" 5 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/host_zoom_map.h" 9 #include "content/public/browser/host_zoom_map.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
11 #include "content/public/browser/stream_handle.h" 11 #include "content/public/browser/stream_handle.h"
12 #include "content/public/browser/stream_info.h" 12 #include "content/public/browser/stream_info.h"
13 #include "content/public/common/service_registry.h" 13 #include "content/public/common/service_registry.h"
14 #include "content/public/common/url_constants.h" 14 #include "content/public/common/url_constants.h"
15 #include "extensions/browser/api/extensions_api_client.h" 15 #include "extensions/browser/api/extensions_api_client.h"
16 #include "extensions/browser/api/mime_handler_private/mime_handler_private.h" 16 #include "extensions/browser/api/mime_handler_private/mime_handler_private.h"
17 #include "extensions/browser/extension_registry.h" 17 #include "extensions/browser/extension_registry.h"
18 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_stream_ma nager.h" 18 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_stream_ma nager.h"
19 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_cons tants.h" 19 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_cons tants.h"
20 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t_delegate.h" 20 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t_delegate.h"
21 #include "extensions/browser/process_manager.h" 21 #include "extensions/browser/process_manager.h"
22 #include "extensions/common/constants.h" 22 #include "extensions/common/constants.h"
23 #include "extensions/common/extension_messages.h" 23 #include "extensions/common/extension_messages.h"
24 #include "extensions/common/guest_view/guest_view_constants.h" 24 #include "extensions/common/guest_view/guest_view_constants.h"
25 #include "extensions/common/guest_view/guest_view_messages.h" 25 #include "extensions/common/guest_view/guest_view_messages.h"
26 #include "extensions/strings/grit/extensions_strings.h" 26 #include "extensions/strings/grit/extensions_strings.h"
27 #include "ipc/ipc_message_macros.h" 27 #include "ipc/ipc_message_macros.h"
28 #include "net/base/url_util.h" 28 #include "net/base/url_util.h"
29 #include "third_party/WebKit/public/web/WebInputEvent.h"
29 30
30 using content::WebContents; 31 using content::WebContents;
31 32
32 namespace extensions { 33 namespace extensions {
33 34
34 StreamContainer::StreamContainer(scoped_ptr<content::StreamInfo> stream, 35 StreamContainer::StreamContainer(scoped_ptr<content::StreamInfo> stream,
35 int tab_id, 36 int tab_id,
36 bool embedded, 37 bool embedded,
37 const GURL& handler_url, 38 const GURL& handler_url,
38 const std::string& extension_id) 39 const std::string& extension_id)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 181 }
181 182
182 bool MimeHandlerViewGuest::HandleContextMenu( 183 bool MimeHandlerViewGuest::HandleContextMenu(
183 const content::ContextMenuParams& params) { 184 const content::ContextMenuParams& params) {
184 if (delegate_) 185 if (delegate_)
185 return delegate_->HandleContextMenu(web_contents(), params); 186 return delegate_->HandleContextMenu(web_contents(), params);
186 187
187 return false; 188 return false;
188 } 189 }
189 190
191 bool MimeHandlerViewGuest::PreHandleGestureEvent(
192 content::WebContents* source,
193 const blink::WebGestureEvent& event) {
194 if (event.type == blink::WebGestureEvent::GesturePinchBegin ||
195 event.type == blink::WebGestureEvent::GesturePinchUpdate ||
196 event.type == blink::WebGestureEvent::GesturePinchEnd) {
197 // If we're an embedded plugin we drop pinch-gestures to avoid zooming the
198 // guest.
199 return !is_full_page_plugin();
200 }
201 return false;
202 }
203
190 void MimeHandlerViewGuest::FindReply(content::WebContents* web_contents, 204 void MimeHandlerViewGuest::FindReply(content::WebContents* web_contents,
191 int request_id, 205 int request_id,
192 int number_of_matches, 206 int number_of_matches,
193 const gfx::Rect& selection_rect, 207 const gfx::Rect& selection_rect,
194 int active_match_ordinal, 208 int active_match_ordinal,
195 bool final_update) { 209 bool final_update) {
196 if (!attached() || !embedder_web_contents()->GetDelegate()) 210 if (!attached() || !embedder_web_contents()->GetDelegate())
197 return; 211 return;
198 212
199 embedder_web_contents()->GetDelegate()->FindReply(embedder_web_contents(), 213 embedder_web_contents()->GetDelegate()->FindReply(embedder_web_contents(),
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 251
238 void MimeHandlerViewGuest::OnRequest( 252 void MimeHandlerViewGuest::OnRequest(
239 const ExtensionHostMsg_Request_Params& params) { 253 const ExtensionHostMsg_Request_Params& params) {
240 if (extension_function_dispatcher_) { 254 if (extension_function_dispatcher_) {
241 extension_function_dispatcher_->Dispatch( 255 extension_function_dispatcher_->Dispatch(
242 params, web_contents()->GetRenderViewHost()); 256 params, web_contents()->GetRenderViewHost());
243 } 257 }
244 } 258 }
245 259
246 } // namespace extensions 260 } // namespace extensions
OLDNEW
« 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