Chromium Code Reviews| Index: content/browser/web_contents/web_contents_impl.cc |
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
| index 8dad3e7904accddb5d06e94501e0e4fc02ede46d..9ab21c105c1f720328dec1d69fc97cee1ad768b7 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -1269,6 +1269,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { |
| RenderViewCreated(GetRenderViewHost()); |
| GetRenderManager()->current_frame_host()->SetRenderFrameCreated(true); |
| } |
| + |
| + // Ensure that observers are notified of the creation of this WebContents' |
|
Charlie Reis
2015/03/02 18:38:26
nit: WebContents's
nasko
2015/03/02 19:30:54
Done.
|
| + // main RenderFrameHost. It must be done here for main frames, since the |
| + // NotifySwappedFromRenderManager expects view_ to be created and it happens |
|
Charlie Reis
2015/03/02 18:38:26
nit: to already be
nit: and that happens
nasko
2015/03/02 19:30:54
Done.
|
| + // after RenderFrameHostManager::Init. |
| + NotifySwappedFromRenderManager( |
| + nullptr, GetRenderManager()->current_frame_host(), true); |
| } |
| void WebContentsImpl::OnWebContentsDestroyed(WebContentsImpl* web_contents) { |
| @@ -4181,7 +4188,7 @@ void WebContentsImpl::NotifySwappedFromRenderManager(RenderFrameHost* old_host, |
| RenderFrameHost* new_host, |
| bool is_main_frame) { |
| if (is_main_frame) { |
| - NotifyViewSwapped(old_host ? old_host->GetRenderViewHost() : NULL, |
| + NotifyViewSwapped(old_host ? old_host->GetRenderViewHost() : nullptr, |
| new_host->GetRenderViewHost()); |
| // Make sure the visible RVH reflects the new delegate's preferences. |
| @@ -4194,6 +4201,13 @@ void WebContentsImpl::NotifySwappedFromRenderManager(RenderFrameHost* old_host, |
| NotifyFrameSwapped(old_host, new_host); |
| } |
| +void WebContentsImpl::NotifyMainFrameSwappedFromRenderManager( |
| + RenderFrameHost* old_host, |
| + RenderFrameHost* new_host) { |
| + NotifyViewSwapped(old_host ? old_host->GetRenderViewHost() : nullptr, |
| + new_host->GetRenderViewHost()); |
| +} |
| + |
| int WebContentsImpl::CreateOpenerRenderViewsForRenderManager( |
| SiteInstance* instance) { |
| if (!opener_) |