| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "extensions/browser/extension_registry.h" | 5 #include "extensions/browser/extension_registry.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "extensions/browser/extension_registry_factory.h" | 8 #include "extensions/browser/extension_registry_factory.h" |
| 9 #include "extensions/browser/extension_registry_observer.h" | 9 #include "extensions/browser/extension_registry_observer.h" |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 UninstallReason reason) { | 80 UninstallReason reason) { |
| 81 DCHECK(!GenerateInstalledExtensionsSet()->Contains(extension->id())); | 81 DCHECK(!GenerateInstalledExtensionsSet()->Contains(extension->id())); |
| 82 FOR_EACH_OBSERVER( | 82 FOR_EACH_OBSERVER( |
| 83 ExtensionRegistryObserver, | 83 ExtensionRegistryObserver, |
| 84 observers_, | 84 observers_, |
| 85 OnExtensionUninstalled(browser_context_, extension, reason)); | 85 OnExtensionUninstalled(browser_context_, extension, reason)); |
| 86 } | 86 } |
| 87 | 87 |
| 88 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, | 88 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, |
| 89 int include_mask) const { | 89 int include_mask) const { |
| 90 std::string lowercase_id = StringToLowerASCII(id); | 90 std::string lowercase_id = base::StringToLowerASCII(id); |
| 91 if (include_mask & ENABLED) { | 91 if (include_mask & ENABLED) { |
| 92 const Extension* extension = enabled_extensions_.GetByID(lowercase_id); | 92 const Extension* extension = enabled_extensions_.GetByID(lowercase_id); |
| 93 if (extension) | 93 if (extension) |
| 94 return extension; | 94 return extension; |
| 95 } | 95 } |
| 96 if (include_mask & DISABLED) { | 96 if (include_mask & DISABLED) { |
| 97 const Extension* extension = disabled_extensions_.GetByID(lowercase_id); | 97 const Extension* extension = disabled_extensions_.GetByID(lowercase_id); |
| 98 if (extension) | 98 if (extension) |
| 99 return extension; | 99 return extension; |
| 100 } | 100 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 disabled_extensions_.set_modification_callback(callback); | 159 disabled_extensions_.set_modification_callback(callback); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void ExtensionRegistry::Shutdown() { | 162 void ExtensionRegistry::Shutdown() { |
| 163 // Release references to all Extension objects in the sets. | 163 // Release references to all Extension objects in the sets. |
| 164 ClearAll(); | 164 ClearAll(); |
| 165 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); | 165 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace extensions | 168 } // namespace extensions |
| OLD | NEW |