OLD | NEW |
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 2670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2681 } | 2681 } |
2682 | 2682 |
2683 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { | 2683 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { |
2684 render_manager_.RenderViewDeleted(rvh); | 2684 render_manager_.RenderViewDeleted(rvh); |
2685 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); | 2685 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); |
2686 } | 2686 } |
2687 | 2687 |
2688 void WebContentsImpl::DidNavigate( | 2688 void WebContentsImpl::DidNavigate( |
2689 RenderViewHost* rvh, | 2689 RenderViewHost* rvh, |
2690 const ViewHostMsg_FrameNavigate_Params& params) { | 2690 const ViewHostMsg_FrameNavigate_Params& params) { |
2691 if (PageTransitionIsMainFrame(params.transition)) | 2691 if (PageTransitionIsMainFrame(params.transition)) { |
| 2692 // When overscroll navigation gesture is enabled, a screenshot of the page |
| 2693 // in its current state is taken so that it can be used during the |
| 2694 // nav-gesture. It is necessary to take the screenshot here, before calling |
| 2695 // RenderViewHostManager::DidNavigateMainFrame, because that can change |
| 2696 // WebContents::GetRenderViewHost to return the new host, instead of the one |
| 2697 // that may have just been swapped out. |
| 2698 controller_.TakeScreenshot(); |
| 2699 |
2692 render_manager_.DidNavigateMainFrame(rvh); | 2700 render_manager_.DidNavigateMainFrame(rvh); |
| 2701 } |
2693 | 2702 |
2694 // Update the site of the SiteInstance if it doesn't have one yet, unless | 2703 // Update the site of the SiteInstance if it doesn't have one yet, unless |
2695 // this is for about:blank. In that case, the SiteInstance can still be | 2704 // this is for about:blank. In that case, the SiteInstance can still be |
2696 // considered unused until a navigation to a real page. | 2705 // considered unused until a navigation to a real page. |
2697 if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() && | 2706 if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() && |
2698 params.url != GURL(chrome::kAboutBlankURL)) { | 2707 params.url != GURL(chrome::kAboutBlankURL)) { |
2699 static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url); | 2708 static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url); |
2700 } | 2709 } |
2701 | 2710 |
2702 // Need to update MIME type here because it's referred to in | 2711 // Need to update MIME type here because it's referred to in |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3396 | 3405 |
3397 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3406 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3398 return browser_plugin_guest_.get(); | 3407 return browser_plugin_guest_.get(); |
3399 } | 3408 } |
3400 | 3409 |
3401 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3410 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3402 return browser_plugin_embedder_.get(); | 3411 return browser_plugin_embedder_.get(); |
3403 } | 3412 } |
3404 | 3413 |
3405 } // namespace content | 3414 } // namespace content |
OLD | NEW |