Index: content/browser/browser_plugin/browser_plugin_embedder.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc |
index 7adbe2b7cde5dd83c8d7499a108d040375f609c9..7aa5a2f7d7ae2efd2a6fb4c94346933b091a6102 100644 |
--- a/content/browser/browser_plugin/browser_plugin_embedder.cc |
+++ b/content/browser/browser_plugin/browser_plugin_embedder.cc |
@@ -110,6 +110,14 @@ void BrowserPluginEmbedder::CreateGuest(RenderViewHost* render_view_host, |
guest_renderer_prefs->throttle_input_events = false; |
AddGuest(instance_id, guest_web_contents); |
guest_web_contents->SetDelegate(guest); |
+ |
+ // Create a swapped out RenderView for the guest in the embedder render |
+ // process, so that the embedder can access the guest's window object. |
+ int guest_routing_id = |
+ static_cast<WebContentsImpl*>(guest->GetWebContents())-> |
+ CreateSwappedOutRenderView(web_contents()->GetSiteInstance()); |
+ render_view_host->Send(new BrowserPluginMsg_GuestContentWindowReady( |
+ instance_id, guest_routing_id)); |
} |
void BrowserPluginEmbedder::NavigateGuest( |
@@ -132,7 +140,7 @@ void BrowserPluginEmbedder::NavigateGuest( |
// TODO(creis): Check the validity of the URL: http://crbug.com/139397. |
guest_web_contents->GetController().LoadURL(url, |
Referrer(), |
- PAGE_TRANSITION_AUTO_SUBFRAME, |
+ PAGE_TRANSITION_AUTO_TOPLEVEL, |
std::string()); |
} |
@@ -244,7 +252,6 @@ void BrowserPluginEmbedder::DestroyGuestByInstanceID(int instance_id) { |
void BrowserPluginEmbedder::RenderViewDeleted( |
RenderViewHost* render_view_host) { |
- DestroyGuests(); |
} |
void BrowserPluginEmbedder::RenderViewGone(base::TerminationStatus status) { |