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

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

Issue 536753003: Add recommended extension installation support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-3
Patch Set: fixes addressing #3 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/extension_management.h ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_management.cc
diff --git a/chrome/browser/extensions/extension_management.cc b/chrome/browser/extensions/extension_management.cc
index 725a729dddb7613f2740770428a86c77dea7f718..3e09d73103481e1183b07219aeae1269c5e1231e 100644
--- a/chrome/browser/extensions/extension_management.cc
+++ b/chrome/browser/extensions/extension_management.cc
@@ -140,22 +140,36 @@ ManagementPolicy::Provider* ExtensionManagement::GetProvider() {
return provider_.get();
}
-bool ExtensionManagement::BlacklistedByDefault() {
+bool ExtensionManagement::BlacklistedByDefault() const {
return default_settings_.installation_mode == INSTALLATION_BLOCKED;
}
scoped_ptr<base::DictionaryValue> ExtensionManagement::GetForceInstallList()
const {
- scoped_ptr<base::DictionaryValue> forcelist(new base::DictionaryValue());
+ scoped_ptr<base::DictionaryValue> install_list(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);
+ install_list.get(), it->first, it->second.update_url);
}
}
- return forcelist.Pass();
+ return install_list.Pass();
+}
+
+scoped_ptr<base::DictionaryValue>
+ExtensionManagement::GetRecommendedInstallList() const {
+ scoped_ptr<base::DictionaryValue> install_list(new base::DictionaryValue());
+ for (SettingsIdMap::const_iterator it = settings_by_id_.begin();
+ it != settings_by_id_.end();
+ ++it) {
+ if (it->second.installation_mode == INSTALLATION_RECOMMENDED) {
+ ExternalPolicyLoader::AddExtension(
+ install_list.get(), it->first, it->second.update_url);
+ }
+ }
+ return install_list.Pass();
}
bool ExtensionManagement::IsInstallationAllowed(const ExtensionId& id) const {
@@ -276,7 +290,7 @@ void ExtensionManagement::Refresh() {
dict_value->GetStringWithoutPathExpansion(
ExternalProviderImpl::kExternalUpdateUrl, &update_url)) {
IndividualSettings* by_id = AccessById(it.key());
- by_id->installation_mode = INSTALLATION_FORCED;
+ by_id->installation_mode = INSTALLATION_RECOMMENDED;
Joao da Silva 2014/09/19 07:55:52 Why? This is the force list, so should be FORCED h
binjin 2014/09/19 09:25:28 it's added by mistake, it's for manual testing.
Joao da Silva 2014/09/19 09:27:48 Ok. Please remove it and send an updated CL when r
binjin 2014/09/19 10:09:56 Done.
by_id->update_url = update_url;
}
}
« no previous file with comments | « chrome/browser/extensions/extension_management.h ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698