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

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

Issue 536573003: Add ExtensionManagement based ExternalLoader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-2
Patch Set: rebase Created 6 years, 3 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/external_provider_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/install_verifier.cc
diff --git a/chrome/browser/extensions/install_verifier.cc b/chrome/browser/extensions/install_verifier.cc
index 7ef862fec0bf7e3e6b92c2be703fd136a5477288..d9cbee6ca88885358268c582bff539657e544a3d 100644
--- a/chrome/browser/extensions/install_verifier.cc
+++ b/chrome/browser/extensions/install_verifier.cc
@@ -13,6 +13,7 @@
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "base/stl_util.h"
+#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/install_signer.h"
#include "chrome/common/chrome_switches.h"
@@ -322,21 +323,8 @@ void InstallVerifier::RemoveMany(const ExtensionIdSet& ids) {
}
bool InstallVerifier::AllowedByEnterprisePolicy(const std::string& id) const {
- PrefService* pref_service = prefs_->pref_service();
- if (pref_service->IsManagedPreference(pref_names::kInstallAllowList)) {
- const base::ListValue* whitelist =
- pref_service->GetList(pref_names::kInstallAllowList);
- base::StringValue id_value(id);
- if (whitelist && whitelist->Find(id_value) != whitelist->end())
- return true;
- }
- if (pref_service->IsManagedPreference(pref_names::kInstallForceList)) {
- const base::DictionaryValue* forcelist =
- pref_service->GetDictionary(pref_names::kInstallForceList);
- if (forcelist && forcelist->HasKey(id))
- return true;
- }
- return false;
+ return ExtensionManagementFactory::GetForBrowserContext(context_)
+ ->IsInstallationAllowed(id);
}
std::string InstallVerifier::GetDebugPolicyProviderName() const {
« no previous file with comments | « chrome/browser/extensions/external_provider_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698