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

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 10542048: Add a group policy controlling which sites can install extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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/extensions/extension_prefs.h ('k') | chrome/browser/policy/configuration_policy_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 41c10171a5dee562a3c3b21bb4a7450a7e186720..6f0f3fbd7915e79add85a92bff3e8ae9d3d7c6b2 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -1904,6 +1904,27 @@ void ExtensionPrefs::ClearIncognitoSessionOnlyContentSettings() {
}
}
+URLPatternSet ExtensionPrefs::GetAllowedInstallSites() {
+ URLPatternSet result;
+ const ListValue* list = prefs_->GetList(prefs::kExtensionAllowedInstallSites);
+ CHECK(list);
+
+ for (size_t i = 0; i < list->GetSize(); ++i) {
+ std::string entry_string;
+ URLPattern entry(URLPattern::SCHEME_ALL);
+ if (!list->GetString(i, &entry_string) ||
+ entry.Parse(entry_string) != URLPattern::PARSE_SUCCESS) {
+ LOG(ERROR) << "Invalid value for preference: "
+ << prefs::kExtensionAllowedInstallSites
+ << "." << i;
+ continue;
+ }
+ result.AddPattern(entry);
+ }
+
+ return result;
+}
+
// static
void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterDictionaryPref(kExtensionsPref, PrefService::UNSYNCABLE_PREF);
@@ -1931,4 +1952,6 @@ void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck,
0, // default value
PrefService::UNSYNCABLE_PREF);
+ prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites,
+ PrefService::UNSYNCABLE_PREF);
}
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/policy/configuration_policy_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698