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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1094153002: Move ClosePage() from RenderViewHost to WebContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chromecast android compile failure. Created 5 years, 8 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/render_view_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 59791b51e94f69bfbe162b375242ea576cb65ebc..35bdeb03878bc3276e29fe619da022fd38463dfb 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -675,6 +675,10 @@ int WebContentsImpl::GetFullscreenWidgetRoutingID() const {
return fullscreen_widget_routing_id_;
}
+void WebContentsImpl::ClosePage() {
+ GetRenderViewHost()->ClosePage();
+}
+
RenderWidgetHostView* WebContentsImpl::GetRenderWidgetHostView() const {
return GetRenderManager()->GetRenderWidgetHostView();
}
@@ -3890,6 +3894,7 @@ void WebContentsImpl::DocumentAvailableInMainFrame(
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DocumentAvailableInMainFrame());
}
+
void WebContentsImpl::RouteCloseEvent(RenderViewHost* rvh) {
// Tell the active RenderViewHost to run unload handlers and close, as long
// as the request came from a RenderViewHost in the same BrowsingInstance.
@@ -3897,7 +3902,7 @@ void WebContentsImpl::RouteCloseEvent(RenderViewHost* rvh) {
// It is possible to receive it from one that has just been swapped in,
// in which case we might as well deliver the message anyway.
if (rvh->GetSiteInstance()->IsRelatedSiteInstance(GetSiteInstance()))
- GetRenderViewHost()->ClosePage();
+ ClosePage();
}
bool WebContentsImpl::ShouldRouteMessageEvent(
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698