| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return extension; | 125 return extension; |
| 126 } | 126 } |
| 127 if (include_mask & BLOCKED) { | 127 if (include_mask & BLOCKED) { |
| 128 const Extension* extension = blocked_extensions_.GetByID(lowercase_id); | 128 const Extension* extension = blocked_extensions_.GetByID(lowercase_id); |
| 129 if (extension) | 129 if (extension) |
| 130 return extension; | 130 return extension; |
| 131 } | 131 } |
| 132 return NULL; | 132 return NULL; |
| 133 } | 133 } |
| 134 | 134 |
| 135 const Extension* ExtensionRegistry::GetInstalledExtension( |
| 136 const std::string& id) const { |
| 137 return GetExtensionById(id, ExtensionRegistry::EVERYTHING); |
| 138 } |
| 139 |
| 135 bool ExtensionRegistry::AddEnabled( | 140 bool ExtensionRegistry::AddEnabled( |
| 136 const scoped_refptr<const Extension>& extension) { | 141 const scoped_refptr<const Extension>& extension) { |
| 137 return enabled_extensions_.Insert(extension); | 142 return enabled_extensions_.Insert(extension); |
| 138 } | 143 } |
| 139 | 144 |
| 140 bool ExtensionRegistry::RemoveEnabled(const std::string& id) { | 145 bool ExtensionRegistry::RemoveEnabled(const std::string& id) { |
| 141 return enabled_extensions_.Remove(id); | 146 return enabled_extensions_.Remove(id); |
| 142 } | 147 } |
| 143 | 148 |
| 144 bool ExtensionRegistry::AddDisabled( | 149 bool ExtensionRegistry::AddDisabled( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 disabled_extensions_.set_modification_callback(callback); | 195 disabled_extensions_.set_modification_callback(callback); |
| 191 } | 196 } |
| 192 | 197 |
| 193 void ExtensionRegistry::Shutdown() { | 198 void ExtensionRegistry::Shutdown() { |
| 194 // Release references to all Extension objects in the sets. | 199 // Release references to all Extension objects in the sets. |
| 195 ClearAll(); | 200 ClearAll(); |
| 196 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); | 201 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); |
| 197 } | 202 } |
| 198 | 203 |
| 199 } // namespace extensions | 204 } // namespace extensions |
| OLD | NEW |