Commit ba45bfdb authored by jam@chromium.org's avatar jam@chromium.org

Get rid of the need of ViewType::VIEW_TYPE_INTERSTITIAL_PAGE in content. There...

Get rid of the need of ViewType::VIEW_TYPE_INTERSTITIAL_PAGE in content. There are no ViewType values left in content, so in the next change I'll move this whole concept out of content and into chrome. That allows us to get rid of RenderViewHostDelegate::GetRenderViewType which is the last remaining need for RVHD in chrome.

BUG=98716
Review URL: https://chromiumcodereview.appspot.com/10383292

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138369 0039d316-1c4b-4281-b951-d872f2087c98
parent ba5771c7
...@@ -433,6 +433,12 @@ void TabSpecificContentSettings::ClearGeolocationContentSettings() { ...@@ -433,6 +433,12 @@ void TabSpecificContentSettings::ClearGeolocationContentSettings() {
geolocation_settings_state_.ClearStateMap(); geolocation_settings_state_.ClearStateMap();
} }
void TabSpecificContentSettings::RenderViewForInterstitialPageCreated(
RenderViewHost* render_view_host) {
render_view_host->Send(new ChromeViewMsg_SetAsInterstitial(
render_view_host->GetRoutingID()));
}
bool TabSpecificContentSettings::OnMessageReceived( bool TabSpecificContentSettings::OnMessageReceived(
const IPC::Message& message) { const IPC::Message& message) {
bool handled = true; bool handled = true;
......
...@@ -187,6 +187,8 @@ class TabSpecificContentSettings : public content::WebContentsObserver, ...@@ -187,6 +187,8 @@ class TabSpecificContentSettings : public content::WebContentsObserver,
} }
// content::WebContentsObserver overrides. // content::WebContentsObserver overrides.
virtual void RenderViewForInterstitialPageCreated(
content::RenderViewHost* render_view_host) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void DidNavigateMainFrame( virtual void DidNavigateMainFrame(
const content::LoadCommittedDetails& details, const content::LoadCommittedDetails& details,
......
...@@ -43,12 +43,6 @@ ChromeRenderViewHostObserver::~ChromeRenderViewHostObserver() { ...@@ -43,12 +43,6 @@ ChromeRenderViewHostObserver::~ChromeRenderViewHostObserver() {
void ChromeRenderViewHostObserver::RenderViewHostInitialized() { void ChromeRenderViewHostObserver::RenderViewHostInitialized() {
InitRenderViewForExtensions(); InitRenderViewForExtensions();
if (render_view_host()->GetDelegate()->GetRenderViewType() ==
content::VIEW_TYPE_INTERSTITIAL_PAGE) {
render_view_host()->Send(new ChromeViewMsg_SetAsInterstitial(
render_view_host()->GetRoutingID()));
}
} }
void ChromeRenderViewHostObserver::RenderViewHostDestroyed( void ChromeRenderViewHostObserver::RenderViewHostDestroyed(
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "content/public/browser/web_contents_view.h" #include "content/public/browser/web_contents_view.h"
#include "content/public/common/bindings_policy.h" #include "content/public/common/bindings_policy.h"
#include "content/public/common/page_transition_types.h" #include "content/public/common/page_transition_types.h"
#include "content/public/common/view_type.h"
#include "net/base/escape.h" #include "net/base/escape.h"
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
#include "webkit/dom_storage/dom_storage_types.h" #include "webkit/dom_storage/dom_storage_types.h"
...@@ -492,6 +491,7 @@ RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() { ...@@ -492,6 +491,7 @@ RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() {
RenderViewHostImpl* render_view_host = new RenderViewHostImpl( RenderViewHostImpl* render_view_host = new RenderViewHostImpl(
SiteInstance::Create(web_contents()->GetBrowserContext()), this, this, SiteInstance::Create(web_contents()->GetBrowserContext()), this, this,
MSG_ROUTING_NONE, false, dom_storage::kInvalidSessionStorageNamespaceId); MSG_ROUTING_NONE, false, dom_storage::kInvalidSessionStorageNamespaceId);
web_contents_->RenderViewForInterstitialPageCreated(render_view_host);
return render_view_host; return render_view_host;
} }
......
...@@ -1104,6 +1104,12 @@ bool WebContentsImpl::NavigateToPendingEntry( ...@@ -1104,6 +1104,12 @@ bool WebContentsImpl::NavigateToPendingEntry(
reload_type); reload_type);
} }
void WebContentsImpl::RenderViewForInterstitialPageCreated(
content::RenderViewHost* render_view_host) {
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
RenderViewForInterstitialPageCreated(render_view_host));
}
bool WebContentsImpl::NavigateToEntry( bool WebContentsImpl::NavigateToEntry(
const NavigationEntryImpl& entry, const NavigationEntryImpl& entry,
NavigationController::ReloadType reload_type) { NavigationController::ReloadType reload_type) {
......
...@@ -112,6 +112,10 @@ class CONTENT_EXPORT WebContentsImpl ...@@ -112,6 +112,10 @@ class CONTENT_EXPORT WebContentsImpl
bool NavigateToPendingEntry( bool NavigateToPendingEntry(
content::NavigationController::ReloadType reload_type); content::NavigationController::ReloadType reload_type);
// Called by InterstitialPageImpl when it creates a RenderViewHost.
void RenderViewForInterstitialPageCreated(
content::RenderViewHost* render_view_host);
// Sets the passed passed interstitial as the currently showing interstitial. // Sets the passed passed interstitial as the currently showing interstitial.
// |interstitial_page| should be non NULL (use the remove_interstitial_page // |interstitial_page| should be non NULL (use the remove_interstitial_page
// method to unset the interstitial) and no interstitial page should be set // method to unset the interstitial) and no interstitial page should be set
......
...@@ -48,7 +48,7 @@ class InterstitialPage { ...@@ -48,7 +48,7 @@ class InterstitialPage {
InterstitialPageDelegate* delegate); InterstitialPageDelegate* delegate);
// Retrieves the InterstitialPage if any associated with the specified // Retrieves the InterstitialPage if any associated with the specified
// |web_contents| (used by ui tests). // |web_contents|.
CONTENT_EXPORT static InterstitialPage* GetInterstitialPage( CONTENT_EXPORT static InterstitialPage* GetInterstitialPage(
WebContents* web_contents); WebContents* web_contents);
......
...@@ -27,7 +27,11 @@ struct Referrer; ...@@ -27,7 +27,11 @@ struct Referrer;
class CONTENT_EXPORT WebContentsObserver : public IPC::Channel::Listener, class CONTENT_EXPORT WebContentsObserver : public IPC::Channel::Listener,
public IPC::Message::Sender { public IPC::Message::Sender {
public: public:
// Only one of the two methods below will be called when a RVH is created for
// a WebContents, depending on whether it's for an interstitial or not.
virtual void RenderViewCreated(RenderViewHost* render_view_host) {} virtual void RenderViewCreated(RenderViewHost* render_view_host) {}
virtual void RenderViewForInterstitialPageCreated(
RenderViewHost* render_view_host) {}
virtual void RenderViewDeleted(RenderViewHost* render_view_host) {} virtual void RenderViewDeleted(RenderViewHost* render_view_host) {}
virtual void RenderViewReady() {} virtual void RenderViewReady() {}
virtual void RenderViewGone(base::TerminationStatus status) {} virtual void RenderViewGone(base::TerminationStatus status) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment