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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 295 } |
296 } | 296 } |
297 | 297 |
298 ExtensionSystemImpl::~ExtensionSystemImpl() { | 298 ExtensionSystemImpl::~ExtensionSystemImpl() { |
299 } | 299 } |
300 | 300 |
301 void ExtensionSystemImpl::Shutdown() { | 301 void ExtensionSystemImpl::Shutdown() { |
302 extension_process_manager_.reset(); | 302 extension_process_manager_.reset(); |
303 } | 303 } |
304 | 304 |
305 void ExtensionSystemImpl::InitForRegularProfile(bool extensions_enabled) { | 305 void ExtensionSystemImpl::InitForRegularProfile( |
| 306 bool extensions_enabled, |
| 307 bool defer_background_creation) { |
306 DCHECK(!profile_->IsOffTheRecord()); | 308 DCHECK(!profile_->IsOffTheRecord()); |
307 if (user_script_master() || extension_service()) | 309 if (user_script_master() || extension_service()) |
308 return; // Already initialized. | 310 return; // Already initialized. |
309 | 311 |
310 // The ExtensionInfoMap needs to be created before the | 312 // The ExtensionInfoMap needs to be created before the |
311 // ExtensionProcessManager. | 313 // ExtensionProcessManager. |
312 shared_->info_map(); | 314 shared_->info_map(); |
313 | 315 |
314 extension_process_manager_.reset(ExtensionProcessManager::Create(profile_)); | 316 extension_process_manager_.reset(ExtensionProcessManager::Create(profile_)); |
315 | 317 |
| 318 extension_process_manager_->DeferBackgroundHostCreation( |
| 319 defer_background_creation); |
| 320 |
316 shared_->Init(extensions_enabled); | 321 shared_->Init(extensions_enabled); |
317 } | 322 } |
318 | 323 |
319 ExtensionService* ExtensionSystemImpl::extension_service() { | 324 ExtensionService* ExtensionSystemImpl::extension_service() { |
320 return shared_->extension_service(); | 325 return shared_->extension_service(); |
321 } | 326 } |
322 | 327 |
323 ManagementPolicy* ExtensionSystemImpl::management_policy() { | 328 ManagementPolicy* ExtensionSystemImpl::management_policy() { |
324 return shared_->management_policy(); | 329 return shared_->management_policy(); |
325 } | 330 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 392 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
388 const std::string& extension_id, | 393 const std::string& extension_id, |
389 const extension_misc::UnloadedExtensionReason reason) { | 394 const extension_misc::UnloadedExtensionReason reason) { |
390 BrowserThread::PostTask( | 395 BrowserThread::PostTask( |
391 BrowserThread::IO, FROM_HERE, | 396 BrowserThread::IO, FROM_HERE, |
392 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 397 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
393 extension_id, reason)); | 398 extension_id, reason)); |
394 } | 399 } |
395 | 400 |
396 } // namespace extensions | 401 } // namespace extensions |
OLD | NEW |