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

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

Issue 10382149: Refactor the various ways to control what users can do to extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Addressing comments from partial review Created 8 years, 7 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/extensions/crx_installer.cc
===================================================================
--- chrome/browser/extensions/crx_installer.cc (revision 138227)
+++ chrome/browser/extensions/crx_installer.cc (working copy)
@@ -26,6 +26,7 @@
#include "chrome/browser/extensions/default_apps_trial.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/permissions_updater.h"
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/profiles/profile.h"
@@ -217,6 +218,9 @@
}
// The checks below are skipped for themes and external installs.
+ // TODO(pamg): After ManagementPolicy refactoring is complete, remove this
+ // and other uses of install_source_ that are no longer needed now that the
+ // SandboxedExtensionUnpacker sets extension->location.
Aaron Boodman 2012/05/29 03:03:08 Hooray.
if (extension->is_theme() || Extension::IsExternalLocation(install_source_))
return true;
@@ -347,12 +351,10 @@
return;
}
- if (!frontend_weak_->extension_prefs()->IsExtensionAllowedByPolicy(
- extension_->id(), install_source_)) {
- ReportFailureFromUIThread(l10n_util::GetStringFUTF16(
- IDS_EXTENSION_CANT_INSTALL_POLICY_BLACKLIST,
- UTF8ToUTF16(extension_->name()),
- UTF8ToUTF16(extension_->id())));
+ string16 error;
+ if (!ExtensionSystem::Get(profile_)->management_policy()->UserMayLoad(
+ extension_, &error)) {
+ ReportFailureFromUIThread(error);
return;
}

Powered by Google App Engine
This is Rietveld 408576698