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) { | 70 void ExtensionRegistry::TriggerOnInstalled(const Extension* extension, |
| 71 bool is_update) { |
71 DCHECK(GenerateInstalledExtensionsSet()->Contains(extension->id())); | 72 DCHECK(GenerateInstalledExtensionsSet()->Contains(extension->id())); |
72 FOR_EACH_OBSERVER(ExtensionRegistryObserver, | 73 FOR_EACH_OBSERVER(ExtensionRegistryObserver, |
73 observers_, | 74 observers_, |
74 OnExtensionInstalled(browser_context_, extension)); | 75 OnExtensionInstalled( |
| 76 browser_context_, extension, is_update)); |
75 } | 77 } |
76 | 78 |
77 void ExtensionRegistry::TriggerOnUninstalled(const Extension* extension) { | 79 void ExtensionRegistry::TriggerOnUninstalled(const Extension* extension) { |
78 DCHECK(!GenerateInstalledExtensionsSet()->Contains(extension->id())); | 80 DCHECK(!GenerateInstalledExtensionsSet()->Contains(extension->id())); |
79 FOR_EACH_OBSERVER(ExtensionRegistryObserver, | 81 FOR_EACH_OBSERVER(ExtensionRegistryObserver, |
80 observers_, | 82 observers_, |
81 OnExtensionUninstalled(browser_context_, extension)); | 83 OnExtensionUninstalled(browser_context_, extension)); |
82 } | 84 } |
83 | 85 |
84 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, | 86 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 disabled_extensions_.set_modification_callback(callback); | 157 disabled_extensions_.set_modification_callback(callback); |
156 } | 158 } |
157 | 159 |
158 void ExtensionRegistry::Shutdown() { | 160 void ExtensionRegistry::Shutdown() { |
159 // Release references to all Extension objects in the sets. | 161 // Release references to all Extension objects in the sets. |
160 ClearAll(); | 162 ClearAll(); |
161 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); | 163 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); |
162 } | 164 } |
163 | 165 |
164 } // namespace extensions | 166 } // namespace extensions |
OLD | NEW |