| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 // Calling UnloadAllExtensionsForTest here triggers a false-positive presubmit | 1401 // Calling UnloadAllExtensionsForTest here triggers a false-positive presubmit |
| 1402 // warning about calling test code in production. | 1402 // warning about calling test code in production. |
| 1403 UnloadAllExtensionsInternal(); | 1403 UnloadAllExtensionsInternal(); |
| 1404 component_loader_->LoadAll(); | 1404 component_loader_->LoadAll(); |
| 1405 extensions::InstalledLoader(this).LoadAllExtensions(); | 1405 extensions::InstalledLoader(this).LoadAllExtensions(); |
| 1406 // Don't call SetReadyAndNotifyListeners() since tests call this multiple | 1406 // Don't call SetReadyAndNotifyListeners() since tests call this multiple |
| 1407 // times. | 1407 // times. |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 void ExtensionService::SetReadyAndNotifyListeners() { | 1410 void ExtensionService::SetReadyAndNotifyListeners() { |
| 1411 const base::TimeTicks start_time = base::TimeTicks::Now(); |
| 1411 ready_->Signal(); | 1412 ready_->Signal(); |
| 1412 content::NotificationService::current()->Notify( | 1413 content::NotificationService::current()->Notify( |
| 1413 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, | 1414 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, |
| 1414 content::Source<Profile>(profile_), | 1415 content::Source<Profile>(profile_), |
| 1415 content::NotificationService::NoDetails()); | 1416 content::NotificationService::NoDetails()); |
| 1417 UMA_HISTOGRAM_TIMES("Extensions.ExtensionServiceNotifyReadyListenersTime", |
| 1418 base::TimeTicks::Now() - start_time); |
| 1416 } | 1419 } |
| 1417 | 1420 |
| 1418 void ExtensionService::OnLoadedInstalledExtensions() { | 1421 void ExtensionService::OnLoadedInstalledExtensions() { |
| 1419 if (updater_) | 1422 if (updater_) |
| 1420 updater_->Start(); | 1423 updater_->Start(); |
| 1421 | 1424 |
| 1422 OnBlacklistUpdated(); | 1425 OnBlacklistUpdated(); |
| 1423 } | 1426 } |
| 1424 | 1427 |
| 1425 void ExtensionService::AddExtension(const Extension* extension) { | 1428 void ExtensionService::AddExtension(const Extension* extension) { |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2529 } | 2532 } |
| 2530 | 2533 |
| 2531 void ExtensionService::OnProfileDestructionStarted() { | 2534 void ExtensionService::OnProfileDestructionStarted() { |
| 2532 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2535 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2533 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2536 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2534 it != ids_to_unload.end(); | 2537 it != ids_to_unload.end(); |
| 2535 ++it) { | 2538 ++it) { |
| 2536 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2539 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2537 } | 2540 } |
| 2538 } | 2541 } |
| OLD | NEW |