OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/extensions/extensions_service.h" | 5 #include "chrome/browser/extensions/extensions_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/chrome_thread.h" | 14 #include "chrome/browser/chrome_thread.h" |
15 #include "chrome/browser/debugger/devtools_manager.h" | 15 #include "chrome/browser/debugger/devtools_manager.h" |
16 #include "chrome/browser/extensions/crx_installer.h" | 16 #include "chrome/browser/extensions/crx_installer.h" |
| 17 #include "chrome/browser/extensions/extension_accessibility_api.h" |
17 #include "chrome/browser/extensions/extension_bookmarks_module.h" | 18 #include "chrome/browser/extensions/extension_bookmarks_module.h" |
18 #include "chrome/browser/extensions/extension_browser_event_router.h" | 19 #include "chrome/browser/extensions/extension_browser_event_router.h" |
19 #include "chrome/browser/extensions/extension_dom_ui.h" | 20 #include "chrome/browser/extensions/extension_dom_ui.h" |
20 #include "chrome/browser/extensions/extension_file_util.h" | 21 #include "chrome/browser/extensions/extension_file_util.h" |
21 #include "chrome/browser/extensions/extension_history_api.h" | 22 #include "chrome/browser/extensions/extension_history_api.h" |
22 #include "chrome/browser/extensions/extension_host.h" | 23 #include "chrome/browser/extensions/extension_host.h" |
23 #include "chrome/browser/extensions/extension_process_manager.h" | 24 #include "chrome/browser/extensions/extension_process_manager.h" |
24 #include "chrome/browser/extensions/extension_updater.h" | 25 #include "chrome/browser/extensions/extension_updater.h" |
25 #include "chrome/browser/extensions/external_extension_provider.h" | 26 #include "chrome/browser/extensions/external_extension_provider.h" |
26 #include "chrome/browser/extensions/external_pref_extension_provider.h" | 27 #include "chrome/browser/extensions/external_pref_extension_provider.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void ExtensionsService::Init() { | 158 void ExtensionsService::Init() { |
158 DCHECK(!ready_); | 159 DCHECK(!ready_); |
159 DCHECK_EQ(extensions_.size(), 0u); | 160 DCHECK_EQ(extensions_.size(), 0u); |
160 | 161 |
161 // Hack: we need to ensure the ResourceDispatcherHost is ready before we load | 162 // Hack: we need to ensure the ResourceDispatcherHost is ready before we load |
162 // the first extension, because its members listen for loaded notifications. | 163 // the first extension, because its members listen for loaded notifications. |
163 g_browser_process->resource_dispatcher_host(); | 164 g_browser_process->resource_dispatcher_host(); |
164 | 165 |
165 // Start up the extension event routers. | 166 // Start up the extension event routers. |
166 ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_); | 167 ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_); |
| 168 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); |
167 | 169 |
168 LoadAllExtensions(); | 170 LoadAllExtensions(); |
169 | 171 |
170 // TODO(erikkay) this should probably be deferred to a future point | 172 // TODO(erikkay) this should probably be deferred to a future point |
171 // rather than running immediately at startup. | 173 // rather than running immediately at startup. |
172 CheckForExternalUpdates(); | 174 CheckForExternalUpdates(); |
173 | 175 |
174 // TODO(erikkay) this should probably be deferred as well. | 176 // TODO(erikkay) this should probably be deferred as well. |
175 GarbageCollectExtensions(); | 177 GarbageCollectExtensions(); |
176 } | 178 } |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 // Finish installing on UI thread. | 1061 // Finish installing on UI thread. |
1060 ChromeThread::PostTask( | 1062 ChromeThread::PostTask( |
1061 ChromeThread::UI, FROM_HERE, | 1063 ChromeThread::UI, FROM_HERE, |
1062 NewRunnableMethod( | 1064 NewRunnableMethod( |
1063 frontend_, | 1065 frontend_, |
1064 &ExtensionsService::ContinueLoadAllExtensions, | 1066 &ExtensionsService::ContinueLoadAllExtensions, |
1065 extensions_to_reload, | 1067 extensions_to_reload, |
1066 start_time, | 1068 start_time, |
1067 true)); | 1069 true)); |
1068 } | 1070 } |
OLD | NEW |