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

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

Issue 475193002: Add a single site view page to view and modify content settings. (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/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 531952ecab655c7044bc120379e1a04836c9766c..1f62241672e4ab7107510409f639eaac1564d121 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -57,6 +57,8 @@
using base::UserMetricsAction;
using extensions::APIPermission;
+using content_settings::ContentSettingToString;
Bernhard Bauer 2014/08/15 14:53:05 Move this before extensions::
Daniel Nishi 2014/08/15 16:56:45 Done.
+using content_settings::ContentSettingFromString;
namespace {
@@ -135,39 +137,6 @@ ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name) {
return CONTENT_SETTINGS_TYPE_DEFAULT;
}
-std::string ContentSettingToString(ContentSetting setting) {
- switch (setting) {
- case CONTENT_SETTING_ALLOW:
- return "allow";
- case CONTENT_SETTING_ASK:
- return "ask";
- case CONTENT_SETTING_BLOCK:
- return "block";
- case CONTENT_SETTING_SESSION_ONLY:
- return "session";
- case CONTENT_SETTING_DEFAULT:
- return "default";
- case CONTENT_SETTING_NUM_SETTINGS:
- NOTREACHED();
- }
-
- return std::string();
-}
-
-ContentSetting ContentSettingFromString(const std::string& name) {
- if (name == "allow")
- return CONTENT_SETTING_ALLOW;
- if (name == "ask")
- return CONTENT_SETTING_ASK;
- if (name == "block")
- return CONTENT_SETTING_BLOCK;
- if (name == "session")
- return CONTENT_SETTING_SESSION_ONLY;
-
- NOTREACHED() << name << " is not a recognized content setting.";
- return CONTENT_SETTING_DEFAULT;
-}
-
// Create a DictionaryValue* that will act as a data source for a single row
// in a HostContentSettingsMap-controlled exceptions table (e.g., cookies).
// Ownership of the pointer is passed to the caller.

Powered by Google App Engine
This is Rietveld 408576698