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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 12082083: overscroll: Allow taking screenshots only in tabbed browsers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 void WebContentsImpl::DidNavigate( 2732 void WebContentsImpl::DidNavigate(
2733 RenderViewHost* rvh, 2733 RenderViewHost* rvh,
2734 const ViewHostMsg_FrameNavigate_Params& params) { 2734 const ViewHostMsg_FrameNavigate_Params& params) {
2735 if (PageTransitionIsMainFrame(params.transition)) { 2735 if (PageTransitionIsMainFrame(params.transition)) {
2736 // When overscroll navigation gesture is enabled, a screenshot of the page 2736 // When overscroll navigation gesture is enabled, a screenshot of the page
2737 // in its current state is taken so that it can be used during the 2737 // in its current state is taken so that it can be used during the
2738 // nav-gesture. It is necessary to take the screenshot here, before calling 2738 // nav-gesture. It is necessary to take the screenshot here, before calling
2739 // RenderViewHostManager::DidNavigateMainFrame, because that can change 2739 // RenderViewHostManager::DidNavigateMainFrame, because that can change
2740 // WebContents::GetRenderViewHost to return the new host, instead of the one 2740 // WebContents::GetRenderViewHost to return the new host, instead of the one
2741 // that may have just been swapped out. 2741 // that may have just been swapped out.
2742 controller_.TakeScreenshot(); 2742 if (delegate_ && delegate_->CanOverscrollContent())
2743 controller_.TakeScreenshot();
2743 2744
2744 render_manager_.DidNavigateMainFrame(rvh); 2745 render_manager_.DidNavigateMainFrame(rvh);
2745 } 2746 }
2746 2747
2747 // Update the site of the SiteInstance if it doesn't have one yet, unless 2748 // Update the site of the SiteInstance if it doesn't have one yet, unless
2748 // this is for about:blank. In that case, the SiteInstance can still be 2749 // this is for about:blank. In that case, the SiteInstance can still be
2749 // considered unused until a navigation to a real page. 2750 // considered unused until a navigation to a real page.
2750 if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() && 2751 if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() &&
2751 params.url != GURL(chrome::kAboutBlankURL)) { 2752 params.url != GURL(chrome::kAboutBlankURL)) {
2752 static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url); 2753 static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url);
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
3449 3450
3450 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3451 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3451 return browser_plugin_guest_.get(); 3452 return browser_plugin_guest_.get();
3452 } 3453 }
3453 3454
3454 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3455 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3455 return browser_plugin_embedder_.get(); 3456 return browser_plugin_embedder_.get();
3456 } 3457 }
3457 3458
3458 } // namespace content 3459 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698