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)); | |
211 if (g_browser_process->profile_manager()->will_import()) { | 210 if (g_browser_process->profile_manager()->will_import()) { |
212 extension_service_->InitEventRoutersAfterImport(); | 211 extension_service_->InitEventRoutersAfterImport(); |
213 } else { | 212 } else { |
214 extension_service_->InitEventRouters(); | 213 extension_service_->InitEventRouters(); |
215 } | 214 } |
216 | 215 |
217 extension_warning_service_.reset(new ExtensionWarningService(profile_)); | 216 extension_warning_service_.reset(new ExtensionWarningService(profile_)); |
218 extension_warning_badge_service_.reset( | 217 extension_warning_badge_service_.reset( |
219 new ExtensionWarningBadgeService(profile_)); | 218 new ExtensionWarningBadgeService(profile_)); |
220 extension_warning_service_->AddObserver( | 219 extension_warning_service_->AddObserver( |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 415 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
417 const std::string& extension_id, | 416 const std::string& extension_id, |
418 const extension_misc::UnloadedExtensionReason reason) { | 417 const extension_misc::UnloadedExtensionReason reason) { |
419 BrowserThread::PostTask( | 418 BrowserThread::PostTask( |
420 BrowserThread::IO, FROM_HERE, | 419 BrowserThread::IO, FROM_HERE, |
421 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 420 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
422 extension_id, reason)); | 421 extension_id, reason)); |
423 } | 422 } |
424 | 423 |
425 } // namespace extensions | 424 } // namespace extensions |
OLD | NEW |