Decouple NavigationControllerImpl and WebContentsImpl.
This CL is the first step in breaking dependencies between WebContents and navigation logic. It creates a NavigationControllerDelegate interface, which contains all the methods NavController needs to call on WebContentsImpl.
More details and roadmap of the changes to come are in https://docs.google.com/a/chromium.org/document/d/127ODQnXaoMtHdu2WXTR6iHg411bXa_8zRTb3kXlwArA/edit.
BUG=304341
Review URL: https://codereview.chromium.org/29693008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230480 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d5bf114..44dd284 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1010,8 +1010,9 @@
max_page_ids_[site_instance->GetId()] = page_id;
}
-void WebContentsImpl::CopyMaxPageIDsFrom(WebContentsImpl* web_contents) {
- max_page_ids_ = web_contents->max_page_ids_;
+void WebContentsImpl::CopyMaxPageIDsFrom(WebContents* web_contents) {
+ WebContentsImpl* contents = static_cast<WebContentsImpl*>(web_contents);
+ max_page_ids_ = contents->max_page_ids_;
}
SiteInstance* WebContentsImpl::GetSiteInstance() const {
@@ -1218,6 +1219,10 @@
}
}
+WebContents* WebContentsImpl::GetWebContents() {
+ return this;
+}
+
void WebContentsImpl::Init(const WebContents::CreateParams& params) {
// This is set before initializing the render_manager_ since render_manager_
// init calls back into us via its delegate to ask if it should be hidden.
@@ -2682,6 +2687,13 @@
BeforeFormRepostWarningShow());
}
+
+void WebContentsImpl::ActivateAndShowRepostFormWarningDialog() {
+ Activate();
+ if (delegate_)
+ delegate_->ShowRepostFormWarningDialog(this);
+}
+
// Notifies the RenderWidgetHost instance about the fact that the page is
// loading, or done loading.
void WebContentsImpl::SetIsLoading(RenderViewHost* render_view_host,