| OLD | NEW | 
|---|
| 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 <stddef.h> | 7 #include <stddef.h> | 
| 8 | 8 | 
| 9 #include <algorithm> | 9 #include <algorithm> | 
| 10 #include <iterator> | 10 #include <iterator> | 
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 224     return false; | 224     return false; | 
| 225   } | 225   } | 
| 226 | 226 | 
| 227   if (is_initial_load) | 227   if (is_initial_load) | 
| 228     update_once_all_providers_are_ready_ = true; | 228     update_once_all_providers_are_ready_ = true; | 
| 229   return true; | 229   return true; | 
| 230 } | 230 } | 
| 231 | 231 | 
| 232 void ExtensionService::OnExternalProviderUpdateComplete( | 232 void ExtensionService::OnExternalProviderUpdateComplete( | 
| 233     const ExternalProviderInterface* provider, | 233     const ExternalProviderInterface* provider, | 
| 234     const ScopedVector<ExternalInstallInfoUpdateUrl>& update_url_extensions, | 234     const std::vector<std::unique_ptr<ExternalInstallInfoUpdateUrl>>& | 
| 235     const ScopedVector<ExternalInstallInfoFile>& file_extensions, | 235         update_url_extensions, | 
|  | 236     const std::vector<std::unique_ptr<ExternalInstallInfoFile>>& | 
|  | 237         file_extensions, | 
| 236     const std::set<std::string>& removed_extensions) { | 238     const std::set<std::string>& removed_extensions) { | 
| 237   // Update pending_extension_manager() with the new extensions first. | 239   // Update pending_extension_manager() with the new extensions first. | 
| 238   for (auto* extension : update_url_extensions) | 240   for (const auto& extension : update_url_extensions) | 
| 239     OnExternalExtensionUpdateUrlFound(*extension, false); | 241     OnExternalExtensionUpdateUrlFound(*extension, false); | 
| 240   for (auto* extension : file_extensions) | 242   for (const auto& extension : file_extensions) | 
| 241     OnExternalExtensionFileFound(*extension); | 243     OnExternalExtensionFileFound(*extension); | 
| 242 | 244 | 
| 243 #if DCHECK_IS_ON() | 245 #if DCHECK_IS_ON() | 
| 244   for (const std::string& id : removed_extensions) { | 246   for (const std::string& id : removed_extensions) { | 
| 245     for (auto* extension : update_url_extensions) | 247     for (const auto& extension : update_url_extensions) | 
| 246       DCHECK_NE(id, extension->extension_id); | 248       DCHECK_NE(id, extension->extension_id); | 
| 247     for (auto* extension : file_extensions) | 249     for (const auto& extension : file_extensions) | 
| 248       DCHECK_NE(id, extension->extension_id); | 250       DCHECK_NE(id, extension->extension_id); | 
| 249   } | 251   } | 
| 250 #endif | 252 #endif | 
| 251 | 253 | 
| 252   // Then uninstall before running |updater_|. | 254   // Then uninstall before running |updater_|. | 
| 253   for (const std::string& id : removed_extensions) | 255   for (const std::string& id : removed_extensions) | 
| 254     CheckExternalUninstall(id); | 256     CheckExternalUninstall(id); | 
| 255 | 257 | 
| 256   if (!update_url_extensions.empty() && updater_) { | 258   if (!update_url_extensions.empty() && updater_) { | 
| 257     // Empty params will cause pending extensions to be updated. | 259     // Empty params will cause pending extensions to be updated. | 
| (...skipping 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2467 } | 2469 } | 
| 2468 | 2470 | 
| 2469 void ExtensionService::OnProfileDestructionStarted() { | 2471 void ExtensionService::OnProfileDestructionStarted() { | 
| 2470   ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2472   ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 
| 2471   for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2473   for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 
| 2472        it != ids_to_unload.end(); | 2474        it != ids_to_unload.end(); | 
| 2473        ++it) { | 2475        ++it) { | 
| 2474     UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2476     UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 
| 2475   } | 2477   } | 
| 2476 } | 2478 } | 
| OLD | NEW | 
|---|