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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 if (include_mask & TERMINATED) { | 101 if (include_mask & TERMINATED) { |
102 const Extension* extension = terminated_extensions_.GetByID(lowercase_id); | 102 const Extension* extension = terminated_extensions_.GetByID(lowercase_id); |
103 if (extension) | 103 if (extension) |
104 return extension; | 104 return extension; |
105 } | 105 } |
106 if (include_mask & BLACKLISTED) { | 106 if (include_mask & BLACKLISTED) { |
107 const Extension* extension = blacklisted_extensions_.GetByID(lowercase_id); | 107 const Extension* extension = blacklisted_extensions_.GetByID(lowercase_id); |
108 if (extension) | 108 if (extension) |
109 return extension; | 109 return extension; |
110 } | 110 } |
111 return NULL; | 111 return nullptr; |
112 } | 112 } |
113 | 113 |
114 bool ExtensionRegistry::AddEnabled( | 114 bool ExtensionRegistry::AddEnabled( |
115 const scoped_refptr<const Extension>& extension) { | 115 const scoped_refptr<const Extension>& extension) { |
116 return enabled_extensions_.Insert(extension); | 116 return enabled_extensions_.Insert(extension); |
117 } | 117 } |
118 | 118 |
119 bool ExtensionRegistry::RemoveEnabled(const std::string& id) { | 119 bool ExtensionRegistry::RemoveEnabled(const std::string& id) { |
120 return enabled_extensions_.Remove(id); | 120 return enabled_extensions_.Remove(id); |
121 } | 121 } |
(...skipping 37 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 |