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

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: 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
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;

Powered by Google App Engine
This is Rietveld 408576698