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 6f590e9fc0280f3677b23b9873b8303d3609bfcd..b3bd05a6b214e08d5efe3022f6397a1e9712cdbd 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -226,11 +226,6 @@ void BrowserPluginGuest::Initialize( |
// Inform the embedder of the guest's attachment. |
SendMessageToEmbedder(new BrowserPluginMsg_Attach_ACK(instance_id_)); |
- |
- if (delegate_) { |
- delegate_->DidAttach(extra_params); |
- has_render_view_ = true; |
- } |
} |
BrowserPluginGuest::~BrowserPluginGuest() { |
@@ -487,6 +482,9 @@ void BrowserPluginGuest::Attach( |
if (attached()) |
return; |
+ if (delegate_) |
+ delegate_->WillAttach(embedder_web_contents, extra_params); |
+ |
// 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. |
@@ -502,6 +500,9 @@ void BrowserPluginGuest::Attach( |
SendQueuedMessages(); |
+ if (delegate_) |
+ delegate_->DidAttach(); |
+ |
RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); |
} |