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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 void ExtensionRegistry::TriggerOnInstalled(const Extension* extension, | 70 void ExtensionRegistry::TriggerOnInstalled(const Extension* extension, |
71 bool is_update) { | 71 bool is_update) { |
72 DCHECK(GenerateInstalledExtensionsSet()->Contains(extension->id())); | 72 DCHECK(GenerateInstalledExtensionsSet()->Contains(extension->id())); |
73 FOR_EACH_OBSERVER(ExtensionRegistryObserver, | 73 FOR_EACH_OBSERVER(ExtensionRegistryObserver, |
74 observers_, | 74 observers_, |
75 OnExtensionInstalled( | 75 OnExtensionInstalled( |
76 browser_context_, extension, is_update)); | 76 browser_context_, extension, is_update)); |
77 } | 77 } |
78 | 78 |
79 void ExtensionRegistry::TriggerOnUninstalled(const Extension* extension) { | 79 void ExtensionRegistry::TriggerOnUninstalled(const Extension* extension, |
| 80 UninstallReason reason) { |
80 DCHECK(!GenerateInstalledExtensionsSet()->Contains(extension->id())); | 81 DCHECK(!GenerateInstalledExtensionsSet()->Contains(extension->id())); |
81 FOR_EACH_OBSERVER(ExtensionRegistryObserver, | 82 FOR_EACH_OBSERVER( |
82 observers_, | 83 ExtensionRegistryObserver, |
83 OnExtensionUninstalled(browser_context_, extension)); | 84 observers_, |
| 85 OnExtensionUninstalled(browser_context_, extension, reason)); |
84 } | 86 } |
85 | 87 |
86 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, | 88 const Extension* ExtensionRegistry::GetExtensionById(const std::string& id, |
87 int include_mask) const { | 89 int include_mask) const { |
88 std::string lowercase_id = StringToLowerASCII(id); | 90 std::string lowercase_id = StringToLowerASCII(id); |
89 if (include_mask & ENABLED) { | 91 if (include_mask & ENABLED) { |
90 const Extension* extension = enabled_extensions_.GetByID(lowercase_id); | 92 const Extension* extension = enabled_extensions_.GetByID(lowercase_id); |
91 if (extension) | 93 if (extension) |
92 return extension; | 94 return extension; |
93 } | 95 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 disabled_extensions_.set_modification_callback(callback); | 159 disabled_extensions_.set_modification_callback(callback); |
158 } | 160 } |
159 | 161 |
160 void ExtensionRegistry::Shutdown() { | 162 void ExtensionRegistry::Shutdown() { |
161 // Release references to all Extension objects in the sets. | 163 // Release references to all Extension objects in the sets. |
162 ClearAll(); | 164 ClearAll(); |
163 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); | 165 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); |
164 } | 166 } |
165 | 167 |
166 } // namespace extensions | 168 } // namespace extensions |
OLD | NEW |