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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 384423002: [Canceled] Extensions: Add install_flags parameter to ManagementPolicy::UserMayLoad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update tests Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 void ExtensionService::CheckManagementPolicy() { 1130 void ExtensionService::CheckManagementPolicy() {
1131 std::vector<std::string> to_unload; 1131 std::vector<std::string> to_unload;
1132 std::map<std::string, Extension::DisableReason> to_disable; 1132 std::map<std::string, Extension::DisableReason> to_disable;
1133 1133
1134 // Loop through the extensions list, finding extensions we need to unload or 1134 // Loop through the extensions list, finding extensions we need to unload or
1135 // disable. 1135 // disable.
1136 const ExtensionSet& extensions = registry_->enabled_extensions(); 1136 const ExtensionSet& extensions = registry_->enabled_extensions();
1137 for (ExtensionSet::const_iterator iter = extensions.begin(); 1137 for (ExtensionSet::const_iterator iter = extensions.begin();
1138 iter != extensions.end(); ++iter) { 1138 iter != extensions.end(); ++iter) {
1139 const Extension* extension = (iter->get()); 1139 const Extension* extension = (iter->get());
1140 if (!system_->management_policy()->UserMayLoad(extension, NULL)) 1140 int install_flags = extension_prefs_->GetInstallFlags(extension->id());
1141 if (!system_->management_policy()->UserMayLoad(
1142 extension, install_flags, NULL))
1141 to_unload.push_back(extension->id()); 1143 to_unload.push_back(extension->id());
1142 Extension::DisableReason disable_reason = Extension::DISABLE_NONE; 1144 Extension::DisableReason disable_reason = Extension::DISABLE_NONE;
1143 if (system_->management_policy()->MustRemainDisabled( 1145 if (system_->management_policy()->MustRemainDisabled(
1144 extension, &disable_reason, NULL)) 1146 extension, &disable_reason, NULL))
1145 to_disable[extension->id()] = disable_reason; 1147 to_disable[extension->id()] = disable_reason;
1146 } 1148 }
1147 1149
1148 for (size_t i = 0; i < to_unload.size(); ++i) 1150 for (size_t i = 0; i < to_unload.size(); ++i)
1149 UnloadExtension(to_unload[i], UnloadedExtensionInfo::REASON_DISABLE); 1151 UnloadExtension(to_unload[i], UnloadedExtensionInfo::REASON_DISABLE);
1150 1152
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2346 } 2348 }
2347 2349
2348 void ExtensionService::OnProfileDestructionStarted() { 2350 void ExtensionService::OnProfileDestructionStarted() {
2349 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2351 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2350 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2352 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2351 it != ids_to_unload.end(); 2353 it != ids_to_unload.end();
2352 ++it) { 2354 ++it) {
2353 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2355 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2354 } 2356 }
2355 } 2357 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_checker.cc ('k') | chrome/browser/extensions/installed_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698