OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/shell/browser/shell_extension_system.h" | 5 #include "extensions/shell/browser/shell_extension_system.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "content/public/browser/browser_context.h" | 12 #include "content/public/browser/browser_context.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 #include "content/public/browser/notification_details.h" | 14 #include "content/public/browser/notification_details.h" |
15 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
16 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
17 #include "extensions/browser/api/app_runtime/app_runtime_api.h" | 17 #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
18 #include "extensions/browser/extension_prefs.h" | 18 #include "extensions/browser/extension_prefs.h" |
19 #include "extensions/browser/extension_registry.h" | 19 #include "extensions/browser/extension_registry.h" |
20 #include "extensions/browser/info_map.h" | 20 #include "extensions/browser/info_map.h" |
21 #include "extensions/browser/notification_types.h" | 21 #include "extensions/browser/notification_types.h" |
22 #include "extensions/browser/null_app_sorting.h" | 22 #include "extensions/browser/null_app_sorting.h" |
23 #include "extensions/browser/quota_service.h" | 23 #include "extensions/browser/quota_service.h" |
| 24 #include "extensions/browser/renderer_startup_helper.h" |
24 #include "extensions/browser/runtime_data.h" | 25 #include "extensions/browser/runtime_data.h" |
25 #include "extensions/browser/service_worker_manager.h" | 26 #include "extensions/browser/service_worker_manager.h" |
26 #include "extensions/browser/value_store/value_store_factory_impl.h" | 27 #include "extensions/browser/value_store/value_store_factory_impl.h" |
27 #include "extensions/common/api/app_runtime.h" | 28 #include "extensions/common/api/app_runtime.h" |
28 #include "extensions/common/constants.h" | 29 #include "extensions/common/constants.h" |
29 #include "extensions/common/file_util.h" | 30 #include "extensions/common/file_util.h" |
30 | 31 |
31 using content::BrowserContext; | 32 using content::BrowserContext; |
32 using content::BrowserThread; | 33 using content::BrowserThread; |
33 | 34 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // * Call ExtensionRegistryObserver::OnExtensionWillbeInstalled(). | 72 // * Call ExtensionRegistryObserver::OnExtensionWillbeInstalled(). |
72 | 73 |
73 ExtensionRegistry::Get(browser_context_)->AddEnabled(extension.get()); | 74 ExtensionRegistry::Get(browser_context_)->AddEnabled(extension.get()); |
74 | 75 |
75 RegisterExtensionWithRequestContexts( | 76 RegisterExtensionWithRequestContexts( |
76 extension.get(), | 77 extension.get(), |
77 base::Bind( | 78 base::Bind( |
78 &ShellExtensionSystem::OnExtensionRegisteredWithRequestContexts, | 79 &ShellExtensionSystem::OnExtensionRegisteredWithRequestContexts, |
79 weak_factory_.GetWeakPtr(), extension)); | 80 weak_factory_.GetWeakPtr(), extension)); |
80 | 81 |
| 82 RendererStartupHelperFactory::GetForBrowserContext(browser_context_) |
| 83 ->OnExtensionLoaded(*extension); |
| 84 |
81 content::NotificationService::current()->Notify( | 85 content::NotificationService::current()->Notify( |
82 NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 86 NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
83 content::Source<BrowserContext>(browser_context_), | 87 content::Source<BrowserContext>(browser_context_), |
84 content::Details<const Extension>(extension.get())); | 88 content::Details<const Extension>(extension.get())); |
85 | 89 |
86 return extension.get(); | 90 return extension.get(); |
87 } | 91 } |
88 | 92 |
89 void ShellExtensionSystem::Init() { | 93 void ShellExtensionSystem::Init() { |
90 // Inform the rest of the extensions system to start. | 94 // Inform the rest of the extensions system to start. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 203 } |
200 | 204 |
201 void ShellExtensionSystem::OnExtensionRegisteredWithRequestContexts( | 205 void ShellExtensionSystem::OnExtensionRegisteredWithRequestContexts( |
202 scoped_refptr<Extension> extension) { | 206 scoped_refptr<Extension> extension) { |
203 ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_); | 207 ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_); |
204 registry->AddReady(extension); | 208 registry->AddReady(extension); |
205 registry->TriggerOnReady(extension.get()); | 209 registry->TriggerOnReady(extension.get()); |
206 } | 210 } |
207 | 211 |
208 } // namespace extensions | 212 } // namespace extensions |
OLD | NEW |