Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2441)

Unified Diff: chrome/browser/ui/webui/options/website_settings_handler.cc

Issue 504773004: Add Cookie permission to Website Settings single side view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/options/website_settings_edit_site.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/browser/resources/options/website_settings_edit_site.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698