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

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

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need to rename addEventListener/removeEventListener Created 8 years, 2 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_embedder.cc
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc
index 091c00c90b0bb8c400514743bb4431de4d7e1599..d92ba0d28fbe2d9e23ccd51ae0d8cb9ea33f7711 100644
--- a/content/browser/browser_plugin/browser_plugin_embedder.cc
+++ b/content/browser/browser_plugin/browser_plugin_embedder.cc
@@ -109,6 +109,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(
@@ -130,7 +138,7 @@ void BrowserPluginEmbedder::NavigateGuest(
if (!src.empty()) {
guest_web_contents->GetController().LoadURL(url,
Referrer(),
- PAGE_TRANSITION_AUTO_SUBFRAME,
+ PAGE_TRANSITION_AUTO_TOPLEVEL,
std::string());
}
@@ -242,7 +250,6 @@ void BrowserPluginEmbedder::DestroyGuestByInstanceID(int instance_id) {
void BrowserPluginEmbedder::RenderViewDeleted(
RenderViewHost* render_view_host) {
- DestroyGuests();
}
void BrowserPluginEmbedder::RenderViewGone(base::TerminationStatus status) {

Powered by Google App Engine
This is Rietveld 408576698