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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // If import is going to run in a separate process (the profile itself is on |
208 // the main process), wait for import to finish before initializing the | 208 // the main process), wait for import to finish before initializing the |
209 // routers. | 209 // routers. |
| 210 CHECK(!ProfileManager::IsImportProcess(*command_line)); |
210 if (g_browser_process->profile_manager()->will_import()) { | 211 if (g_browser_process->profile_manager()->will_import()) { |
211 extension_service_->InitEventRoutersAfterImport(); | 212 extension_service_->InitEventRoutersAfterImport(); |
212 } else { | 213 } else { |
213 extension_service_->InitEventRouters(); | 214 extension_service_->InitEventRouters(); |
214 } | 215 } |
215 | 216 |
216 extension_warning_service_.reset(new ExtensionWarningService(profile_)); | 217 extension_warning_service_.reset(new ExtensionWarningService(profile_)); |
217 extension_warning_badge_service_.reset( | 218 extension_warning_badge_service_.reset( |
218 new ExtensionWarningBadgeService(profile_)); | 219 new ExtensionWarningBadgeService(profile_)); |
219 extension_warning_service_->AddObserver( | 220 extension_warning_service_->AddObserver( |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 416 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
416 const std::string& extension_id, | 417 const std::string& extension_id, |
417 const extension_misc::UnloadedExtensionReason reason) { | 418 const extension_misc::UnloadedExtensionReason reason) { |
418 BrowserThread::PostTask( | 419 BrowserThread::PostTask( |
419 BrowserThread::IO, FROM_HERE, | 420 BrowserThread::IO, FROM_HERE, |
420 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 421 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
421 extension_id, reason)); | 422 extension_id, reason)); |
422 } | 423 } |
423 | 424 |
424 } // namespace extensions | 425 } // namespace extensions |
OLD | NEW |