Initialize BrowserPluginGuest to attach to the View hierarchy
This CL makes sure that a BrowserPluginGuest is attached to its owner's View hierarchy on creation.
This allows the guest WebContents to navigate without needing to be attached to a container, as if it was a worker with a DOM.
This CL will also ACK the last CompositorFrameSwapped message from the guest on attachment if it hasn't been ACK already so that the guest continues to produce frames once it's attached to a new container.
BUG=434226
Review URL: https://codereview.chromium.org/769363002
Cr-Commit-Position: refs/heads/master@{#306983}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 64679cd..9614814 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1196,6 +1196,11 @@
#if defined(OS_ANDROID)
date_time_chooser_.reset(new DateTimeChooserAndroid());
#endif
+
+ // BrowserPluginGuest::Init needs to be called after this WebContents has
+ // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above.
+ if (browser_plugin_guest_)
+ browser_plugin_guest_->Init();
}
void WebContentsImpl::OnWebContentsDestroyed(WebContentsImpl* web_contents) {