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 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 // No need to check for duplicates; inserting a duplicate is a no-op. | 2109 // No need to check for duplicates; inserting a duplicate is a no-op. |
2110 registry_->AddTerminated(make_scoped_refptr(extension)); | 2110 registry_->AddTerminated(make_scoped_refptr(extension)); |
2111 UnloadExtension(extension->id(), UnloadedExtensionInfo::REASON_TERMINATE); | 2111 UnloadExtension(extension->id(), UnloadedExtensionInfo::REASON_TERMINATE); |
2112 } | 2112 } |
2113 | 2113 |
2114 void ExtensionService::TerminateExtension(const std::string& extension_id) { | 2114 void ExtensionService::TerminateExtension(const std::string& extension_id) { |
2115 TrackTerminatedExtension(extension_id); | 2115 TrackTerminatedExtension(extension_id); |
2116 } | 2116 } |
2117 | 2117 |
2118 void ExtensionService::UntrackTerminatedExtension(const std::string& id) { | 2118 void ExtensionService::UntrackTerminatedExtension(const std::string& id) { |
2119 std::string lowercase_id = base::StringToLowerASCII(id); | 2119 std::string lowercase_id = base::ToLowerASCII(id); |
2120 const Extension* extension = | 2120 const Extension* extension = |
2121 registry_->terminated_extensions().GetByID(lowercase_id); | 2121 registry_->terminated_extensions().GetByID(lowercase_id); |
2122 registry_->RemoveTerminated(lowercase_id); | 2122 registry_->RemoveTerminated(lowercase_id); |
2123 if (extension) { | 2123 if (extension) { |
2124 content::NotificationService::current()->Notify( | 2124 content::NotificationService::current()->Notify( |
2125 extensions::NOTIFICATION_EXTENSION_REMOVED, | 2125 extensions::NOTIFICATION_EXTENSION_REMOVED, |
2126 content::Source<Profile>(profile_), | 2126 content::Source<Profile>(profile_), |
2127 content::Details<const Extension>(extension)); | 2127 content::Details<const Extension>(extension)); |
2128 } | 2128 } |
2129 } | 2129 } |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2586 } | 2586 } |
2587 | 2587 |
2588 void ExtensionService::OnProfileDestructionStarted() { | 2588 void ExtensionService::OnProfileDestructionStarted() { |
2589 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2589 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2590 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2590 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2591 it != ids_to_unload.end(); | 2591 it != ids_to_unload.end(); |
2592 ++it) { | 2592 ++it) { |
2593 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2593 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2594 } | 2594 } |
2595 } | 2595 } |
OLD | NEW |