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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 observer.OnExtensionLoaded(browser_context_, extension); | 55 observer.OnExtensionLoaded(browser_context_, extension); |
56 } | 56 } |
57 | 57 |
58 void ExtensionRegistry::TriggerOnReady(const Extension* extension) { | 58 void ExtensionRegistry::TriggerOnReady(const Extension* extension) { |
59 CHECK(extension); | 59 CHECK(extension); |
60 DCHECK(enabled_extensions_.Contains(extension->id())); | 60 DCHECK(enabled_extensions_.Contains(extension->id())); |
61 for (auto& observer : observers_) | 61 for (auto& observer : observers_) |
62 observer.OnExtensionReady(browser_context_, extension); | 62 observer.OnExtensionReady(browser_context_, extension); |
63 } | 63 } |
64 | 64 |
| 65 void ExtensionRegistry::TriggerOnEnabled(const Extension* extension) { |
| 66 CHECK(extension); |
| 67 DCHECK(enabled_extensions_.Contains(extension->id())); |
| 68 for (auto& observer : observers_) |
| 69 observer.OnExtensionEnabled(browser_context_, extension); |
| 70 } |
| 71 |
65 void ExtensionRegistry::TriggerOnUnloaded(const Extension* extension, | 72 void ExtensionRegistry::TriggerOnUnloaded(const Extension* extension, |
66 UnloadedExtensionReason reason) { | 73 UnloadedExtensionReason reason) { |
67 CHECK(extension); | 74 CHECK(extension); |
68 DCHECK(!enabled_extensions_.Contains(extension->id())); | 75 DCHECK(!enabled_extensions_.Contains(extension->id())); |
69 for (auto& observer : observers_) | 76 for (auto& observer : observers_) |
70 observer.OnExtensionUnloaded(browser_context_, extension, reason); | 77 observer.OnExtensionUnloaded(browser_context_, extension, reason); |
71 } | 78 } |
72 | 79 |
73 void ExtensionRegistry::TriggerOnWillBeInstalled(const Extension* extension, | 80 void ExtensionRegistry::TriggerOnWillBeInstalled(const Extension* extension, |
74 bool is_update, | 81 bool is_update, |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 209 } |
203 | 210 |
204 void ExtensionRegistry::Shutdown() { | 211 void ExtensionRegistry::Shutdown() { |
205 // Release references to all Extension objects in the sets. | 212 // Release references to all Extension objects in the sets. |
206 ClearAll(); | 213 ClearAll(); |
207 for (auto& observer : observers_) | 214 for (auto& observer : observers_) |
208 observer.OnShutdown(this); | 215 observer.OnShutdown(this); |
209 } | 216 } |
210 | 217 |
211 } // namespace extensions | 218 } // namespace extensions |
OLD | NEW |