diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-21 16:06:19 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-21 16:06:19 +0000 |
commit | 820ba298c9678a54c28747c4645036d547288595 (patch) | |
tree | 66340725323203402005eb40c2ee617ed0b7315b | |
parent | 0bc96193b26df852d884a6df0bfadff1faa678fd (diff) | |
download | chromium_src-820ba298c9678a54c28747c4645036d547288595.zip chromium_src-820ba298c9678a54c28747c4645036d547288595.tar.gz chromium_src-820ba298c9678a54c28747c4645036d547288595.tar.bz2 |
Remove the RenderViewHostObserver for content settings. RenderViewForInterstitialPageCreated was actually incorrectly called by content, since it should have been called when the RenderView is created (to match RenderViewCreated callback), and not the RenderViewHost.
Also remove the overriding of RenderViewForInterstitialPageCreated in android_webview, which doesn't have interstitials.
BUG=306569
R=jochen@chromium.org, mkosiba@chromium.org
Review URL: https://codereview.chromium.org/29393004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229819 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 10 insertions, 36 deletions
diff --git a/android_webview/native/aw_contents_io_thread_client_impl.cc b/android_webview/native/aw_contents_io_thread_client_impl.cc index 0cd9f20..6e24d9a 100644 --- a/android_webview/native/aw_contents_io_thread_client_impl.cc +++ b/android_webview/native/aw_contents_io_thread_client_impl.cc @@ -109,8 +109,6 @@ class ClientMapEntryUpdater : public content::WebContentsObserver { jobject jdelegate); virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; - virtual void RenderViewForInterstitialPageCreated( - RenderViewHost* render_view_host) OVERRIDE; virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE; virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; @@ -138,11 +136,6 @@ void ClientMapEntryUpdater::RenderViewCreated(RenderViewHost* rvh) { GetRenderViewHostIdPair(rvh), client_data); } -void ClientMapEntryUpdater::RenderViewForInterstitialPageCreated( - RenderViewHost* rvh) { - RenderViewCreated(rvh); -} - void ClientMapEntryUpdater::RenderViewDeleted(RenderViewHost* rvh) { RvhToIoThreadClientMap::GetInstance()->Erase(GetRenderViewHostIdPair(rvh)); } diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 9c019ba..ee562f3 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -29,7 +29,6 @@ #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/render_view_host.h" -#include "content/public/browser/render_view_host_observer.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "net/cookies/canonical_cookie.h" @@ -43,22 +42,6 @@ using content::WebContents; DEFINE_WEB_CONTENTS_USER_DATA_KEY(TabSpecificContentSettings); -namespace { - -class InterstitialHostObserver : public content::RenderViewHostObserver { - public: - explicit InterstitialHostObserver(RenderViewHost* rvh) - : content::RenderViewHostObserver(rvh) {} - - // content::RenderViewHostObserver overrides. - virtual void RenderViewHostInitialized() OVERRIDE { - Send(new ChromeViewMsg_SetAsInterstitial(routing_id())); - delete this; - } -}; - -} // namespace - TabSpecificContentSettings::SiteDataObserver::SiteDataObserver( TabSpecificContentSettings* tab_specific_content_settings) : tab_specific_content_settings_(tab_specific_content_settings) { @@ -664,8 +647,8 @@ void TabSpecificContentSettings::SetPepperBrokerAllowed(bool allowed) { void TabSpecificContentSettings::RenderViewForInterstitialPageCreated( RenderViewHost* render_view_host) { // We want to tell the renderer-side code to ignore content settings for this - // page but we must wait until the RenderView is created. - new InterstitialHostObserver(render_view_host); + // page. + Send(new ChromeViewMsg_SetAsInterstitial(routing_id())); } bool TabSpecificContentSettings::OnMessageReceived( diff --git a/content/browser/web_contents/interstitial_page_impl.cc b/content/browser/web_contents/interstitial_page_impl.cc index 5fa17ff..6489569 100644 --- a/content/browser/web_contents/interstitial_page_impl.cc +++ b/content/browser/web_contents/interstitial_page_impl.cc @@ -501,16 +501,13 @@ RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() { session_storage_namespace_ = new SessionStorageNamespaceImpl(dom_storage_context); - RenderViewHost* render_view_host = - RenderViewHostFactory::Create(site_instance.get(), - this, - this, - MSG_ROUTING_NONE, - MSG_ROUTING_NONE, - false, - false); - web_contents_->RenderViewForInterstitialPageCreated(render_view_host); - return render_view_host; + return RenderViewHostFactory::Create(site_instance.get(), + this, + this, + MSG_ROUTING_NONE, + MSG_ROUTING_NONE, + false, + false); } WebContentsView* InterstitialPageImpl::CreateWebContentsView() { @@ -529,6 +526,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { render_view_host_->CreateRenderView(string16(), MSG_ROUTING_NONE, max_page_id); + web_contents_->RenderViewForInterstitialPageCreated(render_view_host_); view->SetSize(web_contents_view->GetContainerSize()); // Don't show the interstitial until we have navigated to it. view->Hide(); |