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/memory/ptr_util.h" |
7 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
8 #include "extensions/browser/extension_registry_factory.h" | 9 #include "extensions/browser/extension_registry_factory.h" |
9 #include "extensions/browser/extension_registry_observer.h" | 10 #include "extensions/browser/extension_registry_observer.h" |
10 | 11 |
11 namespace extensions { | 12 namespace extensions { |
12 | 13 |
13 ExtensionRegistry::ExtensionRegistry(content::BrowserContext* browser_context) | 14 ExtensionRegistry::ExtensionRegistry(content::BrowserContext* browser_context) |
14 : browser_context_(browser_context) {} | 15 : browser_context_(browser_context) { |
| 16 lazy_event_dispatch_util_ = |
| 17 base::MakeUnique<LazyEventDispatchUtil>(browser_context_, this); |
| 18 } |
| 19 |
15 ExtensionRegistry::~ExtensionRegistry() {} | 20 ExtensionRegistry::~ExtensionRegistry() {} |
16 | 21 |
17 // static | 22 // static |
18 ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) { | 23 ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) { |
19 return ExtensionRegistryFactory::GetForBrowserContext(context); | 24 return ExtensionRegistryFactory::GetForBrowserContext(context); |
20 } | 25 } |
21 | 26 |
22 std::unique_ptr<ExtensionSet> | 27 std::unique_ptr<ExtensionSet> |
23 ExtensionRegistry::GenerateInstalledExtensionsSet() const { | 28 ExtensionRegistry::GenerateInstalledExtensionsSet() const { |
24 return GenerateInstalledExtensionsSet(EVERYTHING); | 29 return GenerateInstalledExtensionsSet(EVERYTHING); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 blacklisted_extensions_.Clear(); | 213 blacklisted_extensions_.Clear(); |
209 blocked_extensions_.Clear(); | 214 blocked_extensions_.Clear(); |
210 ready_extensions_.Clear(); | 215 ready_extensions_.Clear(); |
211 } | 216 } |
212 | 217 |
213 void ExtensionRegistry::Shutdown() { | 218 void ExtensionRegistry::Shutdown() { |
214 // Release references to all Extension objects in the sets. | 219 // Release references to all Extension objects in the sets. |
215 ClearAll(); | 220 ClearAll(); |
216 for (auto& observer : observers_) | 221 for (auto& observer : observers_) |
217 observer.OnShutdown(this); | 222 observer.OnShutdown(this); |
| 223 lazy_event_dispatch_util_.reset(); |
| 224 } |
| 225 |
| 226 LazyEventDispatchUtil* ExtensionRegistry::lazy_event_dispatch_util() { |
| 227 return lazy_event_dispatch_util_.get(); |
218 } | 228 } |
219 | 229 |
220 } // namespace extensions | 230 } // namespace extensions |
OLD | NEW |