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 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 extensions_being_terminated_.erase(extension->id()); | 1918 extensions_being_terminated_.erase(extension->id()); |
1919 UnloadExtension(extension->id(), UnloadedExtensionInfo::REASON_TERMINATE); | 1919 UnloadExtension(extension->id(), UnloadedExtensionInfo::REASON_TERMINATE); |
1920 } | 1920 } |
1921 | 1921 |
1922 void ExtensionService::TerminateExtension(const std::string& extension_id) { | 1922 void ExtensionService::TerminateExtension(const std::string& extension_id) { |
1923 const Extension* extension = GetInstalledExtension(extension_id); | 1923 const Extension* extension = GetInstalledExtension(extension_id); |
1924 TrackTerminatedExtension(extension); | 1924 TrackTerminatedExtension(extension); |
1925 } | 1925 } |
1926 | 1926 |
1927 void ExtensionService::UntrackTerminatedExtension(const std::string& id) { | 1927 void ExtensionService::UntrackTerminatedExtension(const std::string& id) { |
1928 std::string lowercase_id = StringToLowerASCII(id); | 1928 std::string lowercase_id = base::StringToLowerASCII(id); |
1929 const Extension* extension = | 1929 const Extension* extension = |
1930 registry_->terminated_extensions().GetByID(lowercase_id); | 1930 registry_->terminated_extensions().GetByID(lowercase_id); |
1931 registry_->RemoveTerminated(lowercase_id); | 1931 registry_->RemoveTerminated(lowercase_id); |
1932 if (extension) { | 1932 if (extension) { |
1933 content::NotificationService::current()->Notify( | 1933 content::NotificationService::current()->Notify( |
1934 extensions::NOTIFICATION_EXTENSION_REMOVED, | 1934 extensions::NOTIFICATION_EXTENSION_REMOVED, |
1935 content::Source<Profile>(profile_), | 1935 content::Source<Profile>(profile_), |
1936 content::Details<const Extension>(extension)); | 1936 content::Details<const Extension>(extension)); |
1937 } | 1937 } |
1938 } | 1938 } |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2360 } | 2360 } |
2361 | 2361 |
2362 void ExtensionService::OnProfileDestructionStarted() { | 2362 void ExtensionService::OnProfileDestructionStarted() { |
2363 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2363 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2364 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2364 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2365 it != ids_to_unload.end(); | 2365 it != ids_to_unload.end(); |
2366 ++it) { | 2366 ++it) { |
2367 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2367 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2368 } | 2368 } |
2369 } | 2369 } |
OLD | NEW |