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

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 6a058992ed111bc6d71edef0003a64b7ee316a91..3891060099e14b58c176d7c2f15bfc24d49011b2 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2688,8 +2688,17 @@ void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) {
void WebContentsImpl::DidNavigate(
RenderViewHost* rvh,
const ViewHostMsg_FrameNavigate_Params& params) {
- if (PageTransitionIsMainFrame(params.transition))
+ if (PageTransitionIsMainFrame(params.transition)) {
+ // When overscroll navigation gesture is enabled, a screenshot of the page
+ // in its current state is taken so that it can be used during the
+ // nav-gesture. 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();
+
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