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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 Extension::DISABLE_NOT_VERIFIED); | 657 Extension::DISABLE_NOT_VERIFIED); |
658 // Notify interested observers (eg the extensions settings page) by | 658 // Notify interested observers (eg the extensions settings page) by |
659 // sending an UNLOADED notification. | 659 // sending an UNLOADED notification. |
660 // | 660 // |
661 // TODO(asargent) - this is a slight hack because it's already | 661 // TODO(asargent) - this is a slight hack because it's already |
662 // disabled; the right solution might be to add a separate listener | 662 // disabled; the right solution might be to add a separate listener |
663 // interface for DisableReason's changing. http://crbug.com/328916 | 663 // interface for DisableReason's changing. http://crbug.com/328916 |
664 UnloadedExtensionInfo details(&extension, | 664 UnloadedExtensionInfo details(&extension, |
665 UnloadedExtensionInfo::REASON_DISABLE); | 665 UnloadedExtensionInfo::REASON_DISABLE); |
666 content::NotificationService::current()->Notify( | 666 content::NotificationService::current()->Notify( |
667 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 667 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
668 content::Source<Profile>(profile_), | 668 content::Source<Profile>(profile_), |
669 content::Details<UnloadedExtensionInfo>(&details)); | 669 content::Details<UnloadedExtensionInfo>(&details)); |
670 } | 670 } |
671 } | 671 } |
672 // Might disable some extensions. | 672 // Might disable some extensions. |
673 CheckManagementPolicy(); | 673 CheckManagementPolicy(); |
674 } | 674 } |
675 } | 675 } |
676 | 676 |
677 bool ExtensionService::UpdateExtension(const std::string& id, | 677 bool ExtensionService::UpdateExtension(const std::string& id, |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 } | 1198 } |
1199 } | 1199 } |
1200 | 1200 |
1201 void ExtensionService::NotifyExtensionUnloaded( | 1201 void ExtensionService::NotifyExtensionUnloaded( |
1202 const Extension* extension, | 1202 const Extension* extension, |
1203 UnloadedExtensionInfo::Reason reason) { | 1203 UnloadedExtensionInfo::Reason reason) { |
1204 registry_->TriggerOnUnloaded(extension); | 1204 registry_->TriggerOnUnloaded(extension); |
1205 | 1205 |
1206 UnloadedExtensionInfo details(extension, reason); | 1206 UnloadedExtensionInfo details(extension, reason); |
1207 content::NotificationService::current()->Notify( | 1207 content::NotificationService::current()->Notify( |
1208 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 1208 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
1209 content::Source<Profile>(profile_), | 1209 content::Source<Profile>(profile_), |
1210 content::Details<UnloadedExtensionInfo>(&details)); | 1210 content::Details<UnloadedExtensionInfo>(&details)); |
1211 | 1211 |
1212 for (content::RenderProcessHost::iterator i( | 1212 for (content::RenderProcessHost::iterator i( |
1213 content::RenderProcessHost::AllHostsIterator()); | 1213 content::RenderProcessHost::AllHostsIterator()); |
1214 !i.IsAtEnd(); i.Advance()) { | 1214 !i.IsAtEnd(); i.Advance()) { |
1215 content::RenderProcessHost* host = i.GetCurrentValue(); | 1215 content::RenderProcessHost* host = i.GetCurrentValue(); |
1216 Profile* host_profile = | 1216 Profile* host_profile = |
1217 Profile::FromBrowserContext(host->GetBrowserContext()); | 1217 Profile::FromBrowserContext(host->GetBrowserContext()); |
1218 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) | 1218 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) |
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 void ExtensionService::UnloadAllExtensionsInternal() { | 2852 void ExtensionService::UnloadAllExtensionsInternal() { |
2853 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); | 2853 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); |
2854 | 2854 |
2855 registry_->ClearAll(); | 2855 registry_->ClearAll(); |
2856 system_->runtime_data()->ClearAll(); | 2856 system_->runtime_data()->ClearAll(); |
2857 | 2857 |
2858 // TODO(erikkay) should there be a notification for this? We can't use | 2858 // TODO(erikkay) should there be a notification for this? We can't use |
2859 // EXTENSION_UNLOADED since that implies that the extension has been disabled | 2859 // EXTENSION_UNLOADED since that implies that the extension has been disabled |
2860 // or uninstalled. | 2860 // or uninstalled. |
2861 } | 2861 } |
OLD | NEW |