Chromium Code Reviews| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 | 46 |
| 47 void ExtensionRegistry::TriggerOnUnloaded( | 47 void ExtensionRegistry::TriggerOnUnloaded( |
| 48 const Extension* extension, | 48 const Extension* extension, |
| 49 UnloadedExtensionInfo::Reason reason) { | 49 UnloadedExtensionInfo::Reason reason) { |
| 50 DCHECK(!enabled_extensions_.Contains(extension->id())); | 50 DCHECK(!enabled_extensions_.Contains(extension->id())); |
| 51 FOR_EACH_OBSERVER(ExtensionRegistryObserver, | 51 FOR_EACH_OBSERVER(ExtensionRegistryObserver, |
| 52 observers_, | 52 observers_, |
| 53 OnExtensionUnloaded(browser_context_, extension, reason)); | 53 OnExtensionUnloaded(browser_context_, extension, reason)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ExtensionRegistry::TriggerOnWillBeInstalled(const Extension* extension, | |
| 57 bool is_update, | |
| 58 const std::string& old_name) { | |
|
not at google - send to devlin
2014/05/20 18:27:12
I think the DCHECK actually was right and the unit
limasdf
2014/05/21 15:35:08
Done. yeah exactly should do DCHECK depending on |
| |
| 59 FOR_EACH_OBSERVER(ExtensionRegistryObserver, | |
| 60 observers_, | |
| 61 OnExtensionWillBeInstalled( | |
| 62 browser_context_, extension, is_update, old_name)); | |
| 63 } | |
| 64 | |
| 56 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, | 65 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, |
| 57 int include_mask) const { | 66 int include_mask) const { |
| 58 std::string lowercase_id = StringToLowerASCII(id); | 67 std::string lowercase_id = StringToLowerASCII(id); |
| 59 if (include_mask & ENABLED) { | 68 if (include_mask & ENABLED) { |
| 60 const Extension* extension = enabled_extensions_.GetByID(lowercase_id); | 69 const Extension* extension = enabled_extensions_.GetByID(lowercase_id); |
| 61 if (extension) | 70 if (extension) |
| 62 return extension; | 71 return extension; |
| 63 } | 72 } |
| 64 if (include_mask & DISABLED) { | 73 if (include_mask & DISABLED) { |
| 65 const Extension* extension = disabled_extensions_.GetByID(lowercase_id); | 74 const Extension* extension = disabled_extensions_.GetByID(lowercase_id); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 const ExtensionSet::ModificationCallback& callback) { | 135 const ExtensionSet::ModificationCallback& callback) { |
| 127 disabled_extensions_.set_modification_callback(callback); | 136 disabled_extensions_.set_modification_callback(callback); |
| 128 } | 137 } |
| 129 | 138 |
| 130 void ExtensionRegistry::Shutdown() { | 139 void ExtensionRegistry::Shutdown() { |
| 131 // Release references to all Extension objects in the sets. | 140 // Release references to all Extension objects in the sets. |
| 132 ClearAll(); | 141 ClearAll(); |
| 133 } | 142 } |
| 134 | 143 |
| 135 } // namespace extensions | 144 } // namespace extensions |
| OLD | NEW |