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