Chromium Code Reviews| 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 0950ee8417e53b43d20c191c89ed6af2afcd5163..ee4293814d142a5bdaaffd41adb685bef73bb3de 100644 |
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc |
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
| @@ -2,6 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +// Note that all IPC sent out from this class will be dropped on the |
|
Fady Samuel
2015/03/04 20:44:47
I'd like to better understand what we do and don't
|
| +// floor b/c we don't have a BrowserPlugin anymore. |
| #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| #include <algorithm> |
| @@ -242,15 +244,16 @@ void BrowserPluginGuest::InitInternal( |
| params.resize_guest_params.view_size); |
| if (owner_web_contents_ != owner_web_contents) { |
| - WebContentsViewGuest* new_view = |
| - static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); |
| - if (owner_web_contents_) |
| - new_view->OnGuestDetached(owner_web_contents_->GetView()); |
| + // View is not created yet in the case if OOPIF |
| + //WebContentsViewGuest* new_view = |
| + // static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); |
| + //if (owner_web_contents_) |
| + // new_view->OnGuestDetached(owner_web_contents_->GetView()); |
| // Once a BrowserPluginGuest has an embedder WebContents, it's considered to |
| // be attached. |
| owner_web_contents_ = owner_web_contents; |
| - new_view->OnGuestAttached(owner_web_contents_->GetView()); |
| + //new_view->OnGuestAttached(owner_web_contents_->GetView()); |
| } |
| RendererPreferences* renderer_prefs = |
| @@ -604,17 +607,17 @@ void BrowserPluginGuest::Attach( |
| // 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 (has_render_view_) { |
| - // This will trigger a callback to RenderViewReady after a round-trip IPC. |
| - static_cast<RenderViewHostImpl*>( |
| - GetWebContents()->GetRenderViewHost())->Init(); |
| - WebContentsViewGuest* web_contents_view = |
| - static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); |
| - if (!web_contents()->GetRenderViewHost()->GetView()) { |
| - web_contents_view->CreateViewForWidget( |
| - web_contents()->GetRenderViewHost(), true); |
| - } |
| - } |
| + //if (has_render_view_) { |
| + // // This will trigger a callback to RenderViewReady after a round-trip IPC. |
| + // static_cast<RenderViewHostImpl*>( |
| + // GetWebContents()->GetRenderViewHost())->Init(); |
| + // WebContentsViewGuest* web_contents_view = |
| + // static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); |
| + // if (!web_contents()->GetRenderViewHost()->GetView()) { |
| + // web_contents_view->CreateViewForWidget( |
| + // web_contents()->GetRenderViewHost(), true); |
| + // } |
| + //} |
| InitInternal(params, embedder_web_contents); |
| @@ -626,23 +629,24 @@ void BrowserPluginGuest::Attach( |
| // On reattachment, we can reuse the same swapped out RenderView because |
| // the embedder process will always be the same even if the embedder |
| // WebContents changes. |
| - if (guest_proxy_routing_id_ == MSG_ROUTING_NONE) { |
| - guest_proxy_routing_id_ = |
| - GetWebContents()->CreateSwappedOutRenderView( |
| - owner_web_contents_->GetSiteInstance()); |
| - } |
| + // Don't create the proxy here, we'll create it later. |
| + //if (guest_proxy_routing_id_ == MSG_ROUTING_NONE) { |
| + // guest_proxy_routing_id_ = |
| + // GetWebContents()->CreateSwappedOutRenderView( |
| + // owner_web_contents_->GetSiteInstance()); |
| + //} |
| delegate_->DidAttach(guest_proxy_routing_id_); |
| - has_render_view_ = true; |
| + //has_render_view_ = true; |
| - // Enable input method for guest if it's enabled for the embedder. |
| - if (static_cast<RenderViewHostImpl*>( |
| - owner_web_contents_->GetRenderViewHost())->input_method_active()) { |
| - RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( |
| - GetWebContents()->GetRenderViewHost()); |
| - guest_rvh->SetInputMethodActive(true); |
| - } |
| + //// Enable input method for guest if it's enabled for the embedder. |
| + //if (static_cast<RenderViewHostImpl*>( |
| + // owner_web_contents_->GetRenderViewHost())->input_method_active()) { |
| + // RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( |
| + // GetWebContents()->GetRenderViewHost()); |
| + // guest_rvh->SetInputMethodActive(true); |
| + //} |
| RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); |
| } |