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

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: 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/extension_context_menu_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer.cc
===================================================================
--- chrome/browser/extensions/crx_installer.cc (revision 140193)
+++ 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"
@@ -254,6 +255,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.
if (extension->is_theme() || Extension::IsExternalLocation(install_source_))
return true;
@@ -383,12 +387,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;
}
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/extension_context_menu_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698