Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1044)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11776010: overscroll: Take a screenshot at more appropriate times. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698