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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 DCHECK(is_update == | 60 DCHECK(is_update == |
61 GenerateInstalledExtensionsSet()->Contains(extension->id())); | 61 GenerateInstalledExtensionsSet()->Contains(extension->id())); |
62 DCHECK(is_update == !old_name.empty()); | 62 DCHECK(is_update == !old_name.empty()); |
63 FOR_EACH_OBSERVER( | 63 FOR_EACH_OBSERVER( |
64 ExtensionRegistryObserver, | 64 ExtensionRegistryObserver, |
65 observers_, | 65 observers_, |
66 OnExtensionWillBeInstalled( | 66 OnExtensionWillBeInstalled( |
67 browser_context_, extension, is_update, from_ephemeral, old_name)); | 67 browser_context_, extension, is_update, from_ephemeral, old_name)); |
68 } | 68 } |
69 | 69 |
70 void ExtensionRegistry::TriggerOnInstalled(const Extension* extension) { | |
71 DCHECK(GenerateInstalledExtensionsSet()->Contains(extension->id())); | |
asargent_no_longer_on_chrome
2014/06/11 18:27:54
I forget, do the bodies of DCHECK's get completely
tmdiep
2014/06/11 22:56:18
The code doesn't get compiled out completely, but
| |
72 FOR_EACH_OBSERVER(ExtensionRegistryObserver, | |
73 observers_, | |
74 OnExtensionInstalled(browser_context_, extension)); | |
75 } | |
76 | |
70 void ExtensionRegistry::TriggerOnUninstalled(const Extension* extension) { | 77 void ExtensionRegistry::TriggerOnUninstalled(const Extension* extension) { |
71 DCHECK(!GenerateInstalledExtensionsSet()->Contains(extension->id())); | 78 DCHECK(!GenerateInstalledExtensionsSet()->Contains(extension->id())); |
72 FOR_EACH_OBSERVER(ExtensionRegistryObserver, | 79 FOR_EACH_OBSERVER(ExtensionRegistryObserver, |
73 observers_, | 80 observers_, |
74 OnExtensionUninstalled(browser_context_, extension)); | 81 OnExtensionUninstalled(browser_context_, extension)); |
75 } | 82 } |
76 | 83 |
77 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, | 84 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, |
78 int include_mask) const { | 85 int include_mask) const { |
79 std::string lowercase_id = StringToLowerASCII(id); | 86 std::string lowercase_id = StringToLowerASCII(id); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 disabled_extensions_.set_modification_callback(callback); | 155 disabled_extensions_.set_modification_callback(callback); |
149 } | 156 } |
150 | 157 |
151 void ExtensionRegistry::Shutdown() { | 158 void ExtensionRegistry::Shutdown() { |
152 // Release references to all Extension objects in the sets. | 159 // Release references to all Extension objects in the sets. |
153 ClearAll(); | 160 ClearAll(); |
154 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); | 161 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); |
155 } | 162 } |
156 | 163 |
157 } // namespace extensions | 164 } // namespace extensions |
OLD | NEW |