| 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..9d3b68a4bd8e928359166bacc84db10a85400465 100644
|
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc
|
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
|
| @@ -105,16 +105,23 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view,
|
| seen_embedder_drag_source_ended_at_(false),
|
| ignore_dragged_url_(true),
|
| delegate_(delegate),
|
| + delegate_mode_(
|
| + BrowserPluginGuestDelegateMode::USING_CROSS_PROCESS_FRAMES),
|
| weak_ptr_factory_(this) {
|
| DCHECK(web_contents);
|
| DCHECK(delegate);
|
| RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Create"));
|
| web_contents->SetBrowserPluginGuest(this);
|
| delegate->SetGuestHost(this);
|
| + if (delegate_->IsMimeHandlerViewGuest() ||
|
| + !BrowserPluginGuestMode::UseCrossProcessFramesForGuests())
|
| + delegate_mode_ =
|
| + BrowserPluginGuestDelegateMode::NOT_USING_CROSS_PROCESS_FRAMES;
|
| }
|
|
|
| int BrowserPluginGuest::GetGuestProxyRoutingID() {
|
| - if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| + if (delegate_mode_ ==
|
| + BrowserPluginGuestDelegateMode::USING_CROSS_PROCESS_FRAMES) {
|
| // 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 +297,8 @@ void BrowserPluginGuest::InitInternal(
|
|
|
| if (owner_web_contents_ != owner_web_contents) {
|
| WebContentsViewGuest* new_view = nullptr;
|
| - if (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| + if (delegate_mode_ ==
|
| + BrowserPluginGuestDelegateMode::NOT_USING_CROSS_PROCESS_FRAMES) {
|
| new_view =
|
| static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
|
| }
|
| @@ -373,6 +381,12 @@ RenderWidgetHostView* BrowserPluginGuest::GetOwnerRenderWidgetHostView() {
|
| return owner_web_contents_->GetRenderWidgetHostView();
|
| }
|
|
|
| +RenderWidgetHostView* BrowserPluginGuest::GetTopLevelRenderWidgetHostView() {
|
| + if (!owner_web_contents_)
|
| + return nullptr;
|
| + return owner_web_contents_->GetTopLevelRenderWidgetHostView();
|
| +}
|
| +
|
| void BrowserPluginGuest::UpdateVisibility() {
|
| OnSetVisibility(browser_plugin_instance_id(), visible());
|
| }
|
| @@ -677,7 +691,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 (delegate_mode_ ==
|
| + BrowserPluginGuestDelegateMode::USING_CROSS_PROCESS_FRAMES) {
|
| return false;
|
| }
|
|
|
| @@ -927,7 +942,8 @@ 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 (delegate_mode_ ==
|
| + BrowserPluginGuestDelegateMode::USING_CROSS_PROCESS_FRAMES)
|
| return;
|
|
|
| guest_visible_ = visible;
|
|
|