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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 2165523004: Force MimeHandlerView to always use BrowserPlugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing creis@'s comments Created 4 years, 3 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/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index d0a39e22c2d7afa3dcd1fddb5d72c12c4b03d299..9adc622f3ff6e546383f3620340cfb3d9857f192 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -42,11 +42,11 @@
#include "content/public/browser/browser_plugin_guest_manager.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/guest_host.h"
+#include "content/public/browser/guest_mode.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents_observer.h"
-#include "content/public/common/browser_plugin_guest_mode.h"
#include "content/public/common/drop_data.h"
#include "ui/gfx/geometry/size_conversions.h"
@@ -105,6 +105,7 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view,
seen_embedder_drag_source_ended_at_(false),
ignore_dragged_url_(true),
delegate_(delegate),
+ can_use_cross_process_frames_(delegate->CanUseCrossProcessFrames()),
weak_ptr_factory_(this) {
DCHECK(web_contents);
DCHECK(delegate);
@@ -114,7 +115,7 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view,
}
int BrowserPluginGuest::GetGuestProxyRoutingID() {
- if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ if (GuestMode::IsCrossProcessFrameGuest(GetWebContents())) {
// We don't use the proxy to send postMessage in --site-per-process, since
// we use the contentWindow directly from the frame element instead.
return MSG_ROUTING_NONE;
@@ -290,7 +291,7 @@ void BrowserPluginGuest::InitInternal(
if (owner_web_contents_ != owner_web_contents) {
WebContentsViewGuest* new_view = nullptr;
- if (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ if (!GuestMode::IsCrossProcessFrameGuest(GetWebContents())) {
new_view =
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
}
@@ -677,9 +678,8 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) {
// TODO(lazyboy): Fix this as part of http://crbug.com/330264. The required
// parts of code from this class should be extracted to a separate class for
// --site-per-process.
- if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ if (GuestMode::IsCrossProcessFrameGuest(GetWebContents()))
return false;
- }
IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuest, message)
IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition,
@@ -927,7 +927,7 @@ void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent(
void BrowserPluginGuest::OnSetVisibility(int browser_plugin_instance_id,
bool visible) {
// For OOPIF-<webivew>, the remote frame will handle visibility state.
- if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests())
+ if (GuestMode::IsCrossProcessFrameGuest(GetWebContents()))
return;
guest_visible_ = visible;

Powered by Google App Engine
This is Rietveld 408576698