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::TriggerOnUnloaded( | 65 void ExtensionRegistry::TriggerOnUnloaded(const Extension* extension, |
66 const Extension* extension, | 66 UnloadedExtensionReason reason) { |
67 UnloadedExtensionInfo::Reason reason) { | |
68 CHECK(extension); | 67 CHECK(extension); |
69 DCHECK(!enabled_extensions_.Contains(extension->id())); | 68 DCHECK(!enabled_extensions_.Contains(extension->id())); |
70 for (auto& observer : observers_) | 69 for (auto& observer : observers_) |
71 observer.OnExtensionUnloaded(browser_context_, extension, reason); | 70 observer.OnExtensionUnloaded(browser_context_, extension, reason); |
72 } | 71 } |
73 | 72 |
74 void ExtensionRegistry::TriggerOnWillBeInstalled(const Extension* extension, | 73 void ExtensionRegistry::TriggerOnWillBeInstalled(const Extension* extension, |
75 bool is_update, | 74 bool is_update, |
76 const std::string& old_name) { | 75 const std::string& old_name) { |
77 CHECK(extension); | 76 CHECK(extension); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 } | 202 } |
204 | 203 |
205 void ExtensionRegistry::Shutdown() { | 204 void ExtensionRegistry::Shutdown() { |
206 // Release references to all Extension objects in the sets. | 205 // Release references to all Extension objects in the sets. |
207 ClearAll(); | 206 ClearAll(); |
208 for (auto& observer : observers_) | 207 for (auto& observer : observers_) |
209 observer.OnShutdown(this); | 208 observer.OnShutdown(this); |
210 } | 209 } |
211 | 210 |
212 } // namespace extensions | 211 } // namespace extensions |
OLD | NEW |