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

Unified Diff: chrome/browser/extensions/extension_management.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
Index: chrome/browser/extensions/extension_management.cc
diff --git a/chrome/browser/extensions/extension_management.cc b/chrome/browser/extensions/extension_management.cc
index 4fc78f7a62c58985d1511c1358dc37f2b5d5174b..15caf92fcdc9223be5f44ea06435905af991c7b9 100644
--- a/chrome/browser/extensions/extension_management.cc
+++ b/chrome/browser/extensions/extension_management.cc
@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "base/prefs/pref_service.h"
+#include "chrome/browser/extensions/external_policy_loader.h"
#include "chrome/browser/extensions/external_provider_impl.h"
#include "chrome/browser/extensions/standard_management_policy_provider.h"
#include "chrome/browser/profiles/incognito_helpers.h"
@@ -75,6 +76,24 @@ bool ExtensionManagement::BlacklistedByDefault() {
return default_settings_.installation_mode == INSTALLATION_BLOCKED;
}
+scoped_ptr<base::DictionaryValue> ExtensionManagement::GetForceInstallList()
+ const {
+ scoped_ptr<base::DictionaryValue> forcelist(new base::DictionaryValue());
+ for (SettingsIdMap::const_iterator it = settings_by_id_.begin();
+ it != settings_by_id_.end();
+ ++it) {
+ if (it->second.installation_mode == INSTALLATION_FORCED) {
+ ExternalPolicyLoader::AddExtension(
+ forcelist.get(), it->first, it->second.update_url);
+ }
+ }
+ return forcelist.Pass();
+}
+
+bool ExtensionManagement::IsInstallationAllowed(const ExtensionId& id) const {
+ return ReadById(id).installation_mode != INSTALLATION_BLOCKED;
+}
+
const ExtensionManagement::IndividualSettings& ExtensionManagement::ReadById(
const ExtensionId& id) const {
DCHECK(crx_file::id_util::IdIsValid(id)) << "Invalid ID: " << id;
« no previous file with comments | « chrome/browser/extensions/extension_management.h ('k') | chrome/browser/extensions/external_policy_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698