OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extension_system.h" | 5 #include "chrome/browser/extensions/extension_system.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 content::URLDataSource::Add(profile_, new ExtensionIconSource(profile_)); | 197 content::URLDataSource::Add(profile_, new ExtensionIconSource(profile_)); |
198 | 198 |
199 // Initialize extension event routers. Note that on Chrome OS, this will | 199 // Initialize extension event routers. Note that on Chrome OS, this will |
200 // not succeed if the user has not logged in yet, in which case the | 200 // not succeed if the user has not logged in yet, in which case the |
201 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. | 201 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. |
202 // The InitEventRouters call used to be in BrowserMain, because when bookmark | 202 // The InitEventRouters call used to be in BrowserMain, because when bookmark |
203 // import happened on first run, the bookmark bar was not being correctly | 203 // import happened on first run, the bookmark bar was not being correctly |
204 // initialized (see issue 40144). Now that bookmarks aren't imported and | 204 // initialized (see issue 40144). Now that bookmarks aren't imported and |
205 // the event routers need to be initialized for every profile individually, | 205 // the event routers need to be initialized for every profile individually, |
206 // initialize them with the extension service. | 206 // initialize them with the extension service. |
207 // If import is going to run in a separate process (the profile itself is on | 207 extension_service_->InitEventRouters(); |
208 // the main process), wait for import to finish before initializing the | |
209 // routers. | |
210 if (g_browser_process->profile_manager()->will_import()) { | |
211 extension_service_->InitEventRoutersAfterImport(); | |
212 } else { | |
213 extension_service_->InitEventRouters(); | |
214 } | |
215 | 208 |
216 extension_warning_service_.reset(new ExtensionWarningService(profile_)); | 209 extension_warning_service_.reset(new ExtensionWarningService(profile_)); |
217 extension_warning_badge_service_.reset( | 210 extension_warning_badge_service_.reset( |
218 new ExtensionWarningBadgeService(profile_)); | 211 new ExtensionWarningBadgeService(profile_)); |
219 extension_warning_service_->AddObserver( | 212 extension_warning_service_->AddObserver( |
220 extension_warning_badge_service_.get()); | 213 extension_warning_badge_service_.get()); |
221 } | 214 } |
222 | 215 |
223 void ExtensionSystemImpl::Shared::Shutdown() { | 216 void ExtensionSystemImpl::Shared::Shutdown() { |
224 if (extension_warning_service_) { | 217 if (extension_warning_service_) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 368 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
376 const std::string& extension_id, | 369 const std::string& extension_id, |
377 const extension_misc::UnloadedExtensionReason reason) { | 370 const extension_misc::UnloadedExtensionReason reason) { |
378 BrowserThread::PostTask( | 371 BrowserThread::PostTask( |
379 BrowserThread::IO, FROM_HERE, | 372 BrowserThread::IO, FROM_HERE, |
380 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 373 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
381 extension_id, reason)); | 374 extension_id, reason)); |
382 } | 375 } |
383 | 376 |
384 } // namespace extensions | 377 } // namespace extensions |
OLD | NEW |