diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-25 21:37:09 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-25 21:37:09 +0000 |
commit | ea049a01f82647dc12e4001c8be03e4124faaff3 (patch) | |
tree | 0bb59450d13be2f37e404cfd2374ea27fba7461f /chrome/browser/content_settings/tab_specific_content_settings.cc | |
parent | 5ca3ddf71cb1db27e206c4d048770ad21e5688c9 (diff) | |
download | chromium_src-ea049a01f82647dc12e4001c8be03e4124faaff3.zip chromium_src-ea049a01f82647dc12e4001c8be03e4124faaff3.tar.gz chromium_src-ea049a01f82647dc12e4001c8be03e4124faaff3.tar.bz2 |
Convert a bunch of WebContentsObservers to use web_contents() instead of tab_contents(), as well as all the dependent code.
BUG=98716
TBR=joi
Review URL: http://codereview.chromium.org/8982008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115777 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings/tab_specific_content_settings.cc')
-rw-r--r-- | chrome/browser/content_settings/tab_specific_content_settings.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 122e185..bd5a077 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -31,6 +31,7 @@ #include "webkit/fileapi/file_system_types.h" using content::BrowserThread; +using content::WebContents; namespace { typedef std::list<TabSpecificContentSettings*> TabSpecificList; @@ -80,7 +81,7 @@ TabSpecificContentSettings* TabSpecificContentSettings::Get( // latter will miss provisional RenderViewHosts. for (TabSpecificList::iterator i = g_tab_specific.Get().begin(); i != g_tab_specific.Get().end(); ++i) { - if (view->delegate() == (*i)->tab_contents()) + if (view->delegate()->GetAsTabContents() == (*i)->web_contents()) return (*i); } @@ -233,8 +234,8 @@ void TabSpecificContentSettings::OnContentBlocked( content_blocked_[type] = true; // TODO: it would be nice to have a way of mocking this in tests. content::NotificationService::current()->Notify( - chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, - content::Source<TabContents>(tab_contents()), + chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, + content::Source<WebContents>(web_contents()), content::NotificationService::NoDetails()); } } @@ -245,8 +246,8 @@ void TabSpecificContentSettings::OnContentAccessed(ContentSettingsType type) { if (!content_accessed_[type]) { content_accessed_[type] = true; content::NotificationService::current()->Notify( - chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, - content::Source<TabContents>(tab_contents()), + chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, + content::Source<WebContents>(web_contents()), content::NotificationService::NoDetails()); } } @@ -350,8 +351,8 @@ void TabSpecificContentSettings::OnGeolocationPermissionSet( geolocation_settings_state_.OnGeolocationPermissionSet(requesting_origin, allowed); content::NotificationService::current()->Notify( - chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, - content::Source<TabContents>(tab_contents()), + chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, + content::Source<WebContents>(web_contents()), content::NotificationService::NoDetails()); } @@ -366,8 +367,8 @@ void TabSpecificContentSettings::ClearBlockedContentSettingsExceptForCookies() { } load_plugins_link_enabled_ = true; content::NotificationService::current()->Notify( - chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, - content::Source<TabContents>(tab_contents()), + chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, + content::Source<WebContents>(web_contents()), content::NotificationService::NoDetails()); } @@ -378,8 +379,8 @@ void TabSpecificContentSettings::ClearCookieSpecificContentSettings() { content_accessed_[CONTENT_SETTINGS_TYPE_COOKIES] = false; content_blockage_indicated_to_user_[CONTENT_SETTINGS_TYPE_COOKIES] = false; content::NotificationService::current()->Notify( - chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, - content::Source<TabContents>(tab_contents()), + chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, + content::Source<WebContents>(web_contents()), content::NotificationService::NoDetails()); } @@ -387,8 +388,8 @@ void TabSpecificContentSettings::SetPopupsBlocked(bool blocked) { content_blocked_[CONTENT_SETTINGS_TYPE_POPUPS] = blocked; content_blockage_indicated_to_user_[CONTENT_SETTINGS_TYPE_POPUPS] = false; content::NotificationService::current()->Notify( - chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, - content::Source<TabContents>(tab_contents()), + chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, + content::Source<WebContents>(web_contents()), content::NotificationService::NoDetails()); } @@ -464,7 +465,7 @@ void TabSpecificContentSettings::Observe( DCHECK(type == chrome::NOTIFICATION_CONTENT_SETTINGS_CHANGED); content::Details<const ContentSettingsDetails> settings_details(details); - const NavigationController& controller = tab_contents()->GetController(); + const NavigationController& controller = web_contents()->GetController(); NavigationEntry* entry = controller.GetActiveEntry(); GURL entry_url; if (entry) @@ -474,7 +475,7 @@ void TabSpecificContentSettings::Observe( // Currently this should be matched by the |primary_pattern|. settings_details.ptr()->primary_pattern().Matches(entry_url)) { Profile* profile = - Profile::FromBrowserContext(tab_contents()->GetBrowserContext()); + Profile::FromBrowserContext(web_contents()->GetBrowserContext()); RendererContentSettingRules rules; GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |