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 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2671 } | 2671 } |
2672 | 2672 |
2673 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { | 2673 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { |
2674 render_manager_.RenderViewDeleted(rvh); | 2674 render_manager_.RenderViewDeleted(rvh); |
2675 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); | 2675 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); |
2676 } | 2676 } |
2677 | 2677 |
2678 void WebContentsImpl::DidNavigate( | 2678 void WebContentsImpl::DidNavigate( |
2679 RenderViewHost* rvh, | 2679 RenderViewHost* rvh, |
2680 const ViewHostMsg_FrameNavigate_Params& params) { | 2680 const ViewHostMsg_FrameNavigate_Params& params) { |
2681 if (PageTransitionIsMainFrame(params.transition)) | 2681 if (PageTransitionIsMainFrame(params.transition)) { |
| 2682 // When overscroll navigation gesture is enabled, a screenshot of the page |
| 2683 // in its current state is taken so that it can be used during the |
| 2684 // nav-gesture. It is necessary to take the screenshot here, before calling |
| 2685 // RenderViewHostManager::DidNavigateMainFrame, because that can change |
| 2686 // WebContents::GetRenderViewHost to return the new host, instead of the one |
| 2687 // that may have just been swapped out. |
| 2688 controller_.TakeScreenshot(); |
| 2689 |
2682 render_manager_.DidNavigateMainFrame(rvh); | 2690 render_manager_.DidNavigateMainFrame(rvh); |
| 2691 } |
2683 | 2692 |
2684 // 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 |
2685 // 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 |
2686 // considered unused until a navigation to a real page. | 2695 // considered unused until a navigation to a real page. |
2687 if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() && | 2696 if (!static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() && |
2688 params.url != GURL(chrome::kAboutBlankURL)) { | 2697 params.url != GURL(chrome::kAboutBlankURL)) { |
2689 static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url); | 2698 static_cast<SiteInstanceImpl*>(GetSiteInstance())->SetSite(params.url); |
2690 } | 2699 } |
2691 | 2700 |
2692 // 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 Loading... |
3386 | 3395 |
3387 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3396 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3388 return browser_plugin_guest_.get(); | 3397 return browser_plugin_guest_.get(); |
3389 } | 3398 } |
3390 | 3399 |
3391 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3400 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3392 return browser_plugin_embedder_.get(); | 3401 return browser_plugin_embedder_.get(); |
3393 } | 3402 } |
3394 | 3403 |
3395 } // namespace content | 3404 } // namespace content |
OLD | NEW |