summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgfeher@chromium.org <gfeher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-19 14:54:20 +0000
committergfeher@chromium.org <gfeher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-19 14:54:20 +0000
commit63d329f1b39149079172259d99354a1eb400f847 (patch)
tree8c498811fdc199392ba1a72566bef9fbf98d0c03
parentd4d37edcc41703bad2ef4a9b9b53321b3f7203b7 (diff)
downloadchromium_src-63d329f1b39149079172259d99354a1eb400f847.zip
chromium_src-63d329f1b39149079172259d99354a1eb400f847.tar.gz
chromium_src-63d329f1b39149079172259d99354a1eb400f847.tar.bz2
Cleanup: remove duplicate definition of extension policy prefs
BUG=none TEST=ExtensionsServiceTest.BlacklistedByPolicyWillNotInstall Review URL: http://codereview.chromium.org/3832010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63051 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_prefs.cc17
-rw-r--r--chrome/common/pref_names.cc11
2 files changed, 12 insertions, 16 deletions
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 2381c01..5ebae6a 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -37,13 +37,6 @@ const char kPrefBlacklist[] = "blacklist";
// Indicates whether to show an install warning when the user enables.
const char kExtensionDidEscalatePermissions[] = "install_warning_on_enable";
-// A preference that tracks admin policy regarding which extensions the user
-// can and can not install. This preference is a list object, containing
-// strings that list extension ids. Denylist can contain "*" meaning all
-// extensions.
-const char kExtensionInstallAllowList[] = "extensions.install.allowlist";
-const char kExtensionInstallDenyList[] = "extensions.install.denylist";
-
// A preference that tracks browser action toolbar configuration. This is a list
// object stored in the Preferences file. The extensions are stored by ID.
const char kExtensionToolbar[] = "extensions.toolbar";
@@ -284,12 +277,14 @@ bool ExtensionPrefs::IsExtensionAllowedByPolicy(
const std::string& extension_id) {
std::string string_value;
- const ListValue* blacklist = prefs_->GetList(kExtensionInstallDenyList);
+ const ListValue* blacklist =
+ prefs_->GetList(prefs::kExtensionInstallDenyList);
if (!blacklist || blacklist->empty())
return true;
// Check the whitelist first.
- const ListValue* whitelist = prefs_->GetList(kExtensionInstallAllowList);
+ const ListValue* whitelist =
+ prefs_->GetList(prefs::kExtensionInstallAllowList);
if (whitelist) {
for (ListValue::const_iterator it = whitelist->begin();
it != whitelist->end(); ++it) {
@@ -906,7 +901,7 @@ void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterListPref(kExtensionToolbar);
prefs->RegisterIntegerPref(prefs::kExtensionToolbarSize, -1);
prefs->RegisterDictionaryPref(kExtensionsBlacklistUpdate);
- prefs->RegisterListPref(kExtensionInstallAllowList);
- prefs->RegisterListPref(kExtensionInstallDenyList);
+ prefs->RegisterListPref(prefs::kExtensionInstallAllowList);
+ prefs->RegisterListPref(prefs::kExtensionInstallDenyList);
prefs->RegisterStringPref(kWebStoreLogin, std::string() /* default_value */);
}
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index fcd461b..27bc3b7 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -888,12 +888,13 @@ const char kDisableExtensions[] = "extensions.disabled";
const char kBrowserActionContainerWidth[] =
"extensions.browseractions.container.width";
-// A whitelist of extension the user can install. This is controlled by the
-// administrator.
+// A whitelist of extension ids the user can install: exceptions from the
+// following blacklist. This is controlled by the administrator.
const char kExtensionInstallAllowList[] = "extensions.install.allowlist";
-// A blacklist, containing extensions the user cannot install. This is
-// controlled by the administrator. This list should not be confused with
-// the extension blacklist, which is Google controlled.
+// A blacklist, containing extensions the user cannot install. This list can
+// conatin "*" meaning all extensions. This is controlled by the administrator.
+// This list should not be confused with the extension blacklist, which is
+// Google controlled.
const char kExtensionInstallDenyList[] = "extensions.install.denylist";
// Time of the last, and next scheduled, extensions auto-update checks.