diff options
author | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 22:42:39 +0000 |
---|---|---|
committer | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 22:42:39 +0000 |
commit | d84d57bc5729866a1b287356089b6574bd2d8b28 (patch) | |
tree | 462b1c09ce47665092ac24cf0f2845866712781e /content | |
parent | d561d285e9e39682abbe1d07aae6f8c6f863deaa (diff) | |
download | chromium_src-d84d57bc5729866a1b287356089b6574bd2d8b28.zip chromium_src-d84d57bc5729866a1b287356089b6574bd2d8b28.tar.gz chromium_src-d84d57bc5729866a1b287356089b6574bd2d8b28.tar.bz2 |
Remove ContentBrowserClient::GuestWebContentsAttached
BUG=364141
Review URL: https://codereview.chromium.org/334923002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278846 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
5 files changed, 16 insertions, 28 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc index 42f8f95..30b4789 100644 --- a/content/browser/browser_plugin/browser_plugin_embedder.cc +++ b/content/browser/browser_plugin/browser_plugin_embedder.cc @@ -136,18 +136,8 @@ void BrowserPluginEmbedder::OnGuestCallback( : NULL; } - if (guest) { - // There is an implicit order expectation here: - // 1. The content embedder is made aware of the attachment. - // 2. BrowserPluginGuest::Attach is called. - // 3. The content embedder issues queued events if any that happened - // prior to attachment. - GetContentClient()->browser()->GuestWebContentsAttached( - guest->GetWebContents(), - GetWebContents(), - *extra_params); + if (guest) guest->Attach(GetWebContents(), params, *extra_params); - } } void BrowserPluginEmbedder::OnAttach( diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index 6f590e9..b3bd05a 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")); } diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h index 9c82e15..d1bd4ba 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.h +++ b/content/browser/browser_plugin/browser_plugin_guest.h @@ -363,7 +363,9 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver { // Indicates that this BrowserPluginGuest has associated renderer-side state. // This is used to determine whether or not to create a new RenderView when - // this guest is attached. + // this guest is attached. A BrowserPluginGuest would have renderer-side state + // prior to attachment if it is created via a call to window.open and + // maintains a JavaScript reference to its opener. bool has_render_view_; // Last seen size of guest contents (by OnUpdateRect). diff --git a/content/public/browser/browser_plugin_guest_delegate.h b/content/public/browser/browser_plugin_guest_delegate.h index 24dc3a8..7abd737 100644 --- a/content/public/browser/browser_plugin_guest_delegate.h +++ b/content/public/browser/browser_plugin_guest_delegate.h @@ -27,8 +27,13 @@ class CONTENT_EXPORT BrowserPluginGuestDelegate { public: virtual ~BrowserPluginGuestDelegate() {} + // Notification that the embedder will begin attachment. This is called + // prior to resuming resource loads. + virtual void WillAttach(content::WebContents* embedder_web_contents, + const base::DictionaryValue& extra_params) {} + // Notification that the embedder has completed attachment. - virtual void DidAttach(const base::DictionaryValue& extra_params) {} + virtual void DidAttach() {} // Notifies that the content size of the guest has changed in autosize mode. virtual void SizeChanged(const gfx::Size& old_size, diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 95a92fe..d355596 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -159,16 +159,6 @@ class CONTENT_EXPORT ContentBrowserClient { BrowserPluginGuestDelegate** guest_delegate, scoped_ptr<base::DictionaryValue> extra_params) {} - // Notifies that a guest WebContents has been attached to a BrowserPlugin. - // A guest is attached to a BrowserPlugin when the guest has acquired an - // embedder WebContents. This happens on initial navigation or when a new - // window is attached to a BrowserPlugin. |extra_params| are params sent - // from javascript. - virtual void GuestWebContentsAttached( - WebContents* guest_web_contents, - WebContents* embedder_web_contents, - const base::DictionaryValue& extra_params) {} - // Notifies that a render process will be created. This is called before // the content layer adds its own BrowserMessageFilters, so that the // embedder's IPC filters have priority. |