| 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..c09bf2deb5e63de2db28549c35e475fbd53dd7e5 100644
|
| --- a/chrome/browser/ui/webui/options/website_settings_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/website_settings_handler.cc
|
| @@ -29,9 +29,11 @@ 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,
|
| + CONTENT_SETTINGS_TYPE_MEDIASTREAM,
|
| + CONTENT_SETTINGS_TYPE_COOKIES};
|
| const size_t kValidTypesLength = arraysize(kValidTypes);
|
| } // namespace
|
|
|
| @@ -57,6 +59,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 +311,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 +396,10 @@ 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) {
|
| + options->AppendString(content_settings::ContentSettingToString(
|
| + CONTENT_SETTING_SESSION_ONLY));
|
| + }
|
|
|
| ContentSetting permission;
|
| content_settings::SettingInfo info;
|
|
|