| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // not succeed if the user has not logged in yet, in which case the | 214 // not succeed if the user has not logged in yet, in which case the |
| 215 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. | 215 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. |
| 216 // The InitEventRouters call used to be in BrowserMain, because when bookmark | 216 // The InitEventRouters call used to be in BrowserMain, because when bookmark |
| 217 // import happened on first run, the bookmark bar was not being correctly | 217 // import happened on first run, the bookmark bar was not being correctly |
| 218 // initialized (see issue 40144). Now that bookmarks aren't imported and | 218 // initialized (see issue 40144). Now that bookmarks aren't imported and |
| 219 // the event routers need to be initialized for every profile individually, | 219 // the event routers need to be initialized for every profile individually, |
| 220 // initialize them with the extension service. | 220 // initialize them with the extension service. |
| 221 // If import is going to run in a separate process (the profile itself is on | 221 // If import is going to run in a separate process (the profile itself is on |
| 222 // the main process), wait for import to finish before initializing the | 222 // the main process), wait for import to finish before initializing the |
| 223 // routers. | 223 // routers. |
| 224 CHECK(!ProfileManager::IsImportProcess(*command_line)); | |
| 225 if (g_browser_process->profile_manager()->will_import()) { | 224 if (g_browser_process->profile_manager()->will_import()) { |
| 226 extension_service_->InitEventRoutersAfterImport(); | 225 extension_service_->InitEventRoutersAfterImport(); |
| 227 } else { | 226 } else { |
| 228 extension_service_->InitEventRouters(); | 227 extension_service_->InitEventRouters(); |
| 229 } | 228 } |
| 230 | 229 |
| 231 extension_warning_service_.reset(new ExtensionWarningService(profile_)); | 230 extension_warning_service_.reset(new ExtensionWarningService(profile_)); |
| 232 extension_warning_badge_service_.reset( | 231 extension_warning_badge_service_.reset( |
| 233 new ExtensionWarningBadgeService(profile_)); | 232 new ExtensionWarningBadgeService(profile_)); |
| 234 extension_warning_service_->AddObserver( | 233 extension_warning_service_->AddObserver( |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 463 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 465 const std::string& extension_id, | 464 const std::string& extension_id, |
| 466 const extension_misc::UnloadedExtensionReason reason) { | 465 const extension_misc::UnloadedExtensionReason reason) { |
| 467 BrowserThread::PostTask( | 466 BrowserThread::PostTask( |
| 468 BrowserThread::IO, FROM_HERE, | 467 BrowserThread::IO, FROM_HERE, |
| 469 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 468 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
| 470 extension_id, reason)); | 469 extension_id, reason)); |
| 471 } | 470 } |
| 472 | 471 |
| 473 } // namespace extensions | 472 } // namespace extensions |
| OLD | NEW |