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 76fb13a1c0cdbe68f1c18811f931af0394afb08e..193c8713d3c7b69fb41a6bbb62dd1a2b6e0fc1d1 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -2681,8 +2681,14 @@ void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { |
void WebContentsImpl::DidNavigate( |
RenderViewHost* rvh, |
const ViewHostMsg_FrameNavigate_Params& params) { |
- if (PageTransitionIsMainFrame(params.transition)) |
+ if (PageTransitionIsMainFrame(params.transition)) { |
+ // It is necessary to take the screenshot here, before calling |
+ // RenderViewHostManager::DidNavigateMainFrame, because that can change |
+ // WebContents::GetRenderViewHost to return the new host, instead of the one |
+ // that may have just been swapped out. |
+ controller_.TakeScreenshot(); |
Charlie Reis
2013/01/09 00:49:23
nit: Please put a blank line below this.
Also, yo
sadrul
2013/01/09 17:44:19
Done.
|
render_manager_.DidNavigateMainFrame(rvh); |
+ } |
// Update the site of the SiteInstance if it doesn't have one yet, unless |
// this is for about:blank. In that case, the SiteInstance can still be |