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

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: Rebase. 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 983dbed232fffe06c32da9c84a237649cfd8978d..898cf5a14936f91673116c931004a70d1d218a9a 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -56,6 +56,8 @@
#endif
using base::UserMetricsAction;
+using content_settings::ContentSettingToString;
+using content_settings::ContentSettingFromString;
using extensions::APIPermission;
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.
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings.cc ('k') | chrome/browser/ui/webui/options/website_settings_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698