Chromium Code Reviews| Index: chrome/browser/ui/webui/options/content_settings_handler.cc |
| diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc |
| index 4b80c94865573c31d8696f464fca094acaa7b2ea..d43fd44e2aecb577c504158237cc84a6f57bfb59 100644 |
| --- a/chrome/browser/ui/webui/options/content_settings_handler.cc |
| +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc |
| @@ -24,7 +24,6 @@ |
| #include "chrome/browser/ui/browser_list.h" |
| #include "chrome/common/chrome_notification_types.h" |
| #include "chrome/common/chrome_switches.h" |
| -#include "chrome/common/content_settings_helper.h" |
| #include "chrome/common/pref_names.h" |
| #include "chrome/common/url_constants.h" |
| #include "content/browser/tab_contents/tab_contents.h" |
| @@ -168,13 +167,13 @@ DictionaryValue* GetGeolocationExceptionForPage( |
| // in the desktop notifications exceptions table. Ownership of the pointer is |
| // passed to the caller. |
| DictionaryValue* GetNotificationExceptionForPage( |
| - const GURL& url, |
| + const ContentSettingsPattern& pattern, |
| ContentSetting setting) { |
| DictionaryValue* exception = new DictionaryValue(); |
| exception->SetString(kDisplayPattern, |
| - content_settings_helper::OriginToString(url)); |
| + pattern.ToString()); |
|
battre
2011/08/29 17:44:04
nit: single line
markusheintz_
2011/08/30 15:14:02
Done.
|
| exception->SetString(kSetting, ContentSettingToString(setting)); |
| - exception->SetString(kOrigin, url.spec()); |
| + exception->SetString(kOrigin, pattern.ToString()); |
| return exception; |
| } |
| @@ -510,17 +509,17 @@ void ContentSettingsHandler::UpdateNotificationExceptionsView() { |
| DesktopNotificationService* service = |
| DesktopNotificationServiceFactory::GetForProfile(profile); |
| - std::vector<GURL> allowed(service->GetAllowedOrigins()); |
| - std::vector<GURL> blocked(service->GetBlockedOrigins()); |
| + HostContentSettingsMap::SettingsForOneType settings; |
| + service->GetNotificationsSettings(&settings); |
| ListValue exceptions; |
| - for (size_t i = 0; i < allowed.size(); ++i) { |
| - exceptions.Append( |
| - GetNotificationExceptionForPage(allowed[i], CONTENT_SETTING_ALLOW)); |
| - } |
| - for (size_t i = 0; i < blocked.size(); ++i) { |
| + for (HostContentSettingsMap::SettingsForOneType::const_iterator i = |
| + settings.begin(); |
| + i != settings.end(); |
| + ++i) { |
| + const HostContentSettingsMap::PatternSettingSourceTuple& tuple(*i); |
| exceptions.Append( |
| - GetNotificationExceptionForPage(blocked[i], CONTENT_SETTING_BLOCK)); |
| + GetNotificationExceptionForPage(tuple.a, tuple.c)); |
|
battre
2011/08/29 17:44:04
please add a TODO, to HostContentSettingsMap::Patt
markusheintz_
2011/08/30 15:14:02
Added TODO in host_content_settings_map.h where th
|
| } |
| StringValue type_string( |
| @@ -653,11 +652,11 @@ void ContentSettingsHandler::RemoveException(const ListValue* args) { |
| ContentSetting content_setting = ContentSettingFromString(setting); |
| if (content_setting == CONTENT_SETTING_ALLOW) { |
|
battre
2011/08/29 17:44:04
this can be simplified if ResetAllowedOrigin and R
markusheintz_
2011/08/30 15:14:02
You are right. I was afraid that this CL might gro
|
| DesktopNotificationServiceFactory::GetForProfile(profile)-> |
| - ResetAllowedOrigin(GURL(origin)); |
| + ResetAllowedOrigin(ContentSettingsPattern::FromString(origin)); |
| } else { |
| DCHECK_EQ(content_setting, CONTENT_SETTING_BLOCK); |
| DesktopNotificationServiceFactory::GetForProfile(profile)-> |
| - ResetBlockedOrigin(GURL(origin)); |
| + ResetBlockedOrigin(ContentSettingsPattern::FromString(origin)); |
| } |
| } else { |
| std::string mode; |