| 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 359d53a20daea7fd8787a603edafd186a2c70d8b..3068eae4a8ebb33005c25e168da9e9b93ff29e51 100644
|
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc
|
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
|
| @@ -6,7 +6,6 @@
|
|
|
| #include <algorithm>
|
|
|
| -#include "base/command_line.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/pickle.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| @@ -38,7 +37,7 @@
|
| #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/content_switches.h"
|
| +#include "content/public/common/browser_plugin_guest_mode.h"
|
| #include "content/public/common/drop_data.h"
|
| #include "ui/gfx/geometry/size_conversions.h"
|
|
|
| @@ -109,8 +108,7 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view,
|
| }
|
|
|
| int BrowserPluginGuest::GetGuestProxyRoutingID() {
|
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kSitePerProcess)) {
|
| + if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| // 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;
|
| @@ -278,8 +276,7 @@ void BrowserPluginGuest::InitInternal(
|
|
|
| if (owner_web_contents_ != owner_web_contents) {
|
| WebContentsViewGuest* new_view = nullptr;
|
| - if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kSitePerProcess)) {
|
| + if (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| new_view =
|
| static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
|
| }
|
| @@ -631,8 +628,7 @@ 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 (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kSitePerProcess)) {
|
| + if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| return false;
|
| }
|
|
|
| @@ -716,12 +712,12 @@ void BrowserPluginGuest::Attach(
|
| void BrowserPluginGuest::OnWillAttachComplete(
|
| WebContentsImpl* embedder_web_contents,
|
| const BrowserPluginHostMsg_Attach_Params& params) {
|
| - bool use_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kSitePerProcess);
|
| + bool use_cross_process_frames =
|
| + BrowserPluginGuestMode::UseCrossProcessFramesForGuests();
|
| // If a RenderView has already been created for this new window, then we need
|
| // to initialize the browser-side state now so that the RenderFrameHostManager
|
| // does not create a new RenderView on navigation.
|
| - if (!use_site_per_process && has_render_view_) {
|
| + if (!use_cross_process_frames && has_render_view_) {
|
| // This will trigger a callback to RenderViewReady after a round-trip IPC.
|
| static_cast<RenderViewHostImpl*>(
|
| GetWebContents()->GetRenderViewHost())->Init();
|
| @@ -741,7 +737,7 @@ void BrowserPluginGuest::OnWillAttachComplete(
|
|
|
| delegate_->DidAttach(GetGuestProxyRoutingID());
|
|
|
| - if (!use_site_per_process)
|
| + if (!use_cross_process_frames)
|
| has_render_view_ = true;
|
|
|
| RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached"));
|
|
|