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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 2165523004: Force MimeHandlerView to always use BrowserPlugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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 "chrome/browser/renderer_context_menu/render_view_context_menu.h" 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "chrome/common/chrome_switches.h" 67 #include "chrome/common/chrome_switches.h"
68 #include "chrome/common/content_restriction.h" 68 #include "chrome/common/content_restriction.h"
69 #include "chrome/common/pref_names.h" 69 #include "chrome/common/pref_names.h"
70 #include "chrome/common/render_messages.h" 70 #include "chrome/common/render_messages.h"
71 #include "chrome/common/spellcheck_common.h" 71 #include "chrome/common/spellcheck_common.h"
72 #include "chrome/common/url_constants.h" 72 #include "chrome/common/url_constants.h"
73 #include "chrome/grit/generated_resources.h" 73 #include "chrome/grit/generated_resources.h"
74 #include "components/autofill/core/common/password_generation_util.h" 74 #include "components/autofill/core/common/password_generation_util.h"
75 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade rs.h" 75 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade rs.h"
76 #include "components/google/core/browser/google_util.h" 76 #include "components/google/core/browser/google_util.h"
77 #include "components/guest_view/browser/guest_view_base.h"
77 #include "components/metrics/proto/omnibox_input_type.pb.h" 78 #include "components/metrics/proto/omnibox_input_type.pb.h"
78 #include "components/omnibox/browser/autocomplete_classifier.h" 79 #include "components/omnibox/browser/autocomplete_classifier.h"
79 #include "components/omnibox/browser/autocomplete_match.h" 80 #include "components/omnibox/browser/autocomplete_match.h"
80 #include "components/password_manager/core/common/experiments.h" 81 #include "components/password_manager/core/common/experiments.h"
81 #include "components/prefs/pref_member.h" 82 #include "components/prefs/pref_member.h"
82 #include "components/prefs/pref_service.h" 83 #include "components/prefs/pref_service.h"
83 #include "components/search_engines/template_url.h" 84 #include "components/search_engines/template_url.h"
84 #include "components/search_engines/template_url_service.h" 85 #include "components/search_engines/template_url_service.h"
85 #include "components/translate/core/browser/translate_download_manager.h" 86 #include "components/translate/core/browser/translate_download_manager.h"
86 #include "components/translate/core/browser/translate_manager.h" 87 #include "components/translate/core/browser/translate_manager.h"
(...skipping 14 matching lines...) Expand all
101 #include "content/public/browser/render_widget_host_view.h" 102 #include "content/public/browser/render_widget_host_view.h"
102 #include "content/public/browser/storage_partition.h" 103 #include "content/public/browser/storage_partition.h"
103 #include "content/public/browser/user_metrics.h" 104 #include "content/public/browser/user_metrics.h"
104 #include "content/public/browser/web_contents.h" 105 #include "content/public/browser/web_contents.h"
105 #include "content/public/common/browser_plugin_guest_mode.h" 106 #include "content/public/common/browser_plugin_guest_mode.h"
106 #include "content/public/common/menu_item.h" 107 #include "content/public/common/menu_item.h"
107 #include "content/public/common/ssl_status.h" 108 #include "content/public/common/ssl_status.h"
108 #include "content/public/common/url_utils.h" 109 #include "content/public/common/url_utils.h"
109 #include "extensions/browser/extension_host.h" 110 #include "extensions/browser/extension_host.h"
110 #include "extensions/browser/extension_system.h" 111 #include "extensions/browser/extension_system.h"
112 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h"
111 #include "extensions/browser/guest_view/web_view/web_view_guest.h" 113 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
112 #include "extensions/browser/view_type_utils.h" 114 #include "extensions/browser/view_type_utils.h"
113 #include "extensions/common/extension.h" 115 #include "extensions/common/extension.h"
114 #include "net/base/escape.h" 116 #include "net/base/escape.h"
115 #include "third_party/WebKit/public/web/WebContextMenuData.h" 117 #include "third_party/WebKit/public/web/WebContextMenuData.h"
116 #include "third_party/WebKit/public/web/WebMediaPlayerAction.h" 118 #include "third_party/WebKit/public/web/WebMediaPlayerAction.h"
117 #include "third_party/WebKit/public/web/WebPluginAction.h" 119 #include "third_party/WebKit/public/web/WebPluginAction.h"
118 #include "ui/base/clipboard/clipboard.h" 120 #include "ui/base/clipboard/clipboard.h"
119 #include "ui/base/clipboard/scoped_clipboard_writer.h" 121 #include "ui/base/clipboard/scoped_clipboard_writer.h"
120 #include "ui/base/l10n/l10n_util.h" 122 #include "ui/base/l10n/l10n_util.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 495
494 } // namespace 496 } // namespace
495 497
496 // static 498 // static
497 gfx::Vector2d RenderViewContextMenu::GetOffset( 499 gfx::Vector2d RenderViewContextMenu::GetOffset(
498 RenderFrameHost* render_frame_host) { 500 RenderFrameHost* render_frame_host) {
499 gfx::Vector2d offset; 501 gfx::Vector2d offset;
500 #if defined(ENABLE_EXTENSIONS) 502 #if defined(ENABLE_EXTENSIONS)
501 // When --use-cross-process-frames-for-guests is enabled, the position is 503 // When --use-cross-process-frames-for-guests is enabled, the position is
502 // transformed in the browser process hittesting code. 504 // transformed in the browser process hittesting code.
503 if (!content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { 505 // TODO(ekaramad): For now, MimeHandlerView is based on BrowserPlugin even
506 // when guests use OOPIF. Remove the check below when MimeHandlerView is also
507 // based on OOPIF (https://crbug.com/563285).
508 WebContents* web_contents =
509 WebContents::FromRenderFrameHost(render_frame_host);
510 if (!content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests() ||
lazyboy 2016/07/22 01:03:30 I think the CL has too many BPGuestMode::UseCrossP
EhsanK 2016/07/27 22:34:47 There is more instances of UseCross... but I found
511 guest_view::GuestViewBase::IsForMimeHandlerViewGuest(web_contents)) {
504 WebContents* web_contents = 512 WebContents* web_contents =
505 WebContents::FromRenderFrameHost(render_frame_host); 513 WebContents::FromRenderFrameHost(render_frame_host);
506 WebContents* top_level_web_contents = 514 WebContents* top_level_web_contents =
507 guest_view::GuestViewBase::GetTopLevelWebContents(web_contents); 515 guest_view::GuestViewBase::GetTopLevelWebContents(web_contents);
508 if (web_contents && top_level_web_contents && 516 if (web_contents && top_level_web_contents &&
509 web_contents != top_level_web_contents) { 517 web_contents != top_level_web_contents) {
510 gfx::Rect bounds = web_contents->GetContainerBounds(); 518 gfx::Rect bounds = web_contents->GetContainerBounds();
511 gfx::Rect top_level_bounds = top_level_web_contents->GetContainerBounds(); 519 gfx::Rect top_level_bounds = top_level_web_contents->GetContainerBounds();
512 offset = bounds.origin() - top_level_bounds.origin(); 520 offset = bounds.origin() - top_level_bounds.origin();
513 } 521 }
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after
2438 source_web_contents_->GetRenderViewHost()-> 2446 source_web_contents_->GetRenderViewHost()->
2439 ExecuteMediaPlayerActionAtLocation(location, action); 2447 ExecuteMediaPlayerActionAtLocation(location, action);
2440 } 2448 }
2441 2449
2442 void RenderViewContextMenu::PluginActionAt( 2450 void RenderViewContextMenu::PluginActionAt(
2443 const gfx::Point& location, 2451 const gfx::Point& location,
2444 const WebPluginAction& action) { 2452 const WebPluginAction& action) {
2445 source_web_contents_->GetRenderViewHost()-> 2453 source_web_contents_->GetRenderViewHost()->
2446 ExecutePluginActionAtLocation(location, action); 2454 ExecutePluginActionAtLocation(location, action);
2447 } 2455 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698