summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/crx_installer.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 14:56:36 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 14:56:36 +0000
commit306a2bd6e1bdabbe0cb5a70e17fe9a3eee08b5f9 (patch)
treed4e2239ea87c5552c19a7cd33f2af8d76473a603 /chrome/browser/extensions/crx_installer.cc
parent1bf88f540099cb145757a3572dbab90faff9bf1e (diff)
downloadchromium_src-306a2bd6e1bdabbe0cb5a70e17fe9a3eee08b5f9.zip
chromium_src-306a2bd6e1bdabbe0cb5a70e17fe9a3eee08b5f9.tar.gz
chromium_src-306a2bd6e1bdabbe0cb5a70e17fe9a3eee08b5f9.tar.bz2
Implement admin control (by policy) over which extensions the user can install and run. Currently we intercept in two locations:
1) When the user tries to install an extension (includes error message). 2) Every time the browser starts up and the currently installed extensions are loaded (silently skips the extension). I implemented a whitelist and a blacklist approach, calling it a allow/deny list to not clash with the global blacklist we have for extensions. A blacklist of '*' means all extensions are blacklisted. If an extension is on the blacklist it cannot be installed/loaded, unless it also appears on the whitelist. I also fleshed out the LIST_TYPE support for policy values, so that we don't have to use comma separated REG_SZ values for lists and can instead use ADM support for listboxes. BUG=47085 TEST=ExtensionsServiceTest.BlacklistedByPolicyWillNotInstall, ConfigurationPolicyProviderWinTest.TestExtensionInstall* Review URL: http://codereview.chromium.org/3014053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55727 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/crx_installer.cc')
-rw-r--r--chrome/browser/extensions/crx_installer.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index ddc1404..b24a02d 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -201,6 +201,12 @@ void CrxInstaller::ConfirmInstall() {
return;
}
+ if (!frontend_->extension_prefs()->IsExtensionAllowedByPolicy(
+ extension_->id())) {
+ ReportFailureFromUIThread("This extension is blacklisted by admin policy.");
+ return;
+ }
+
GURL overlapping_url;
Extension* overlapping_extension =
frontend_->GetExtensionByOverlappingWebExtent(extension_->web_extent());