Chromium Code Reviews| Index: chrome/browser/ui/webui/options/website_settings_handler.cc |
| diff --git a/chrome/browser/ui/webui/options/website_settings_handler.cc b/chrome/browser/ui/webui/options/website_settings_handler.cc |
| index 8999398729c5b6544fce9b9304da7b763dc23797..61f95593b60883c3db6637c3fbc0999eceaac2c2 100644 |
| --- a/chrome/browser/ui/webui/options/website_settings_handler.cc |
| +++ b/chrome/browser/ui/webui/options/website_settings_handler.cc |
| @@ -29,9 +29,9 @@ const int kHttpPort = 80; |
| const int kHttpsPort = 443; |
| const char kPreferencesSource[] = "preference"; |
| const char kStorage[] = "storage"; |
| -const ContentSettingsType kValidTypes[] = {CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| - CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
| - CONTENT_SETTINGS_TYPE_MEDIASTREAM}; |
| +const ContentSettingsType kValidTypes[] = { |
| + CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
|
Bernhard Bauer
2014/08/26 08:12:27
Put each on an individual line.
Daniel Nishi
2014/08/26 17:26:50
Done.
|
| + CONTENT_SETTINGS_TYPE_MEDIASTREAM, CONTENT_SETTINGS_TYPE_COOKIES}; |
| const size_t kValidTypesLength = arraysize(kValidTypes); |
| } // namespace |
| @@ -57,6 +57,7 @@ void WebsiteSettingsHandler::GetLocalizedValues( |
| {"websitesLabelMediaStream", IDS_WEBSITE_SETTINGS_TYPE_MEDIASTREAM}, |
| {"websitesLabelNotifications", IDS_WEBSITE_SETTINGS_TYPE_NOTIFICATIONS}, |
| {"websitesLabelStorage", IDS_WEBSITE_SETTINGS_TYPE_STORAGE}, |
| + {"websitesCookiesDescription", IDS_WEBSITE_SETTINGS_COOKIES_DESCRIPTION}, |
| {"websitesLocationDescription", |
| IDS_WEBSITE_SETTINGS_LOCATION_DESCRIPTION}, |
| {"websitesMediastreamDescription", |
| @@ -308,6 +309,10 @@ void WebsiteSettingsHandler::HandleSetOriginPermission( |
| ContentSettingsPattern primary_pattern; |
| ContentSettingsPattern secondary_pattern; |
| switch (settings_type) { |
| + case CONTENT_SETTINGS_TYPE_COOKIES: |
| + primary_pattern = ContentSettingsPattern::FromURLNoWildcard(last_site_); |
| + secondary_pattern = ContentSettingsPattern::FromURLNoWildcard(last_site_); |
| + break; |
| case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| primary_pattern = ContentSettingsPattern::FromURLNoWildcard(last_site_); |
| secondary_pattern = ContentSettingsPattern::Wildcard(); |
| @@ -389,6 +394,9 @@ void WebsiteSettingsHandler::GetInfoForOrigin(const GURL& site_url, |
| content_settings::ContentSettingToString(CONTENT_SETTING_ALLOW)); |
| options->AppendString( |
| content_settings::ContentSettingToString(CONTENT_SETTING_BLOCK)); |
| + if (permission_type == CONTENT_SETTINGS_TYPE_COOKIES) |
|
Bernhard Bauer
2014/08/26 08:12:27
Wrap multiline bodies in braces.
Daniel Nishi
2014/08/26 17:26:50
Done.
|
| + options->AppendString(content_settings::ContentSettingToString( |
| + CONTENT_SETTING_SESSION_ONLY)); |
| ContentSetting permission; |
| content_settings::SettingInfo info; |