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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 2663 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 } 2674 }
2675 2675
2676 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { 2676 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) {
2677 render_manager_.RenderViewDeleted(rvh); 2677 render_manager_.RenderViewDeleted(rvh);
2678 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); 2678 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh));
2679 } 2679 }
2680 2680
2681 void WebContentsImpl::DidNavigate( 2681 void WebContentsImpl::DidNavigate(
2682 RenderViewHost* rvh, 2682 RenderViewHost* rvh,
2683 const ViewHostMsg_FrameNavigate_Params& params) { 2683 const ViewHostMsg_FrameNavigate_Params& params) {
2684 if (PageTransitionIsMainFrame(params.transition)) 2684 if (PageTransitionIsMainFrame(params.transition)) {
2685 // It is necessary to take the screenshot here, before calling
2686 // RenderViewHostManager::DidNavigateMainFrame, because that can change
2687 // WebContents::GetRenderViewHost to return the new host, instead of the one
2688 // that may have just been swapped out.
2689 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.
2685 render_manager_.DidNavigateMainFrame(rvh); 2690 render_manager_.DidNavigateMainFrame(rvh);
2691 }
2686 2692
2687 // Update the site of the SiteInstance if it doesn't have one yet, unless 2693 // Update the site of the SiteInstance if it doesn't have one yet, unless
2688 // this is for about:blank. In that case, the SiteInstance can still be 2694 // this is for about:blank. In that case, the SiteInstance can still be
2689 // considered unused until a navigation to a real page. 2695 // considered unused until a navigation to a real page.
2690 if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() && 2696 if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() &&
2691 params.url != GURL(chrome::kAboutBlankURL)) { 2697 params.url != GURL(chrome::kAboutBlankURL)) {
2692 static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url); 2698 static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url);
2693 } 2699 }
2694 2700
2695 // Need to update MIME type here because it's referred to in 2701 // Need to update MIME type here because it's referred to in
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
3389 3395
3390 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3396 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3391 return browser_plugin_guest_.get(); 3397 return browser_plugin_guest_.get();
3392 } 3398 }
3393 3399
3394 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3400 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3395 return browser_plugin_embedder_.get(); 3401 return browser_plugin_embedder_.get();
3396 } 3402 }
3397 3403
3398 } // namespace content 3404 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698