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 <set> | 5 #include <set> |
6 | 6 |
7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/deferred_sequenced_task_runner.h" |
11 #include "base/file_util.h" | 12 #include "base/file_util.h" |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
13 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
14 #include "base/prefs/pref_registry_simple.h" | 15 #include "base/prefs/pref_registry_simple.h" |
15 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
17 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
18 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
19 #include "chrome/browser/bookmarks/bookmark_model.h" | 20 #include "chrome/browser/bookmarks/bookmark_model.h" |
20 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 21 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
21 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/content_settings/host_content_settings_map.h" | 23 #include "chrome/browser/content_settings/host_content_settings_map.h" |
23 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 24 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
24 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" | 25 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
25 #include "chrome/browser/profiles/profile_destroyer.h" | 26 #include "chrome/browser/profiles/profile_destroyer.h" |
26 #include "chrome/browser/profiles/profile_info_cache.h" | 27 #include "chrome/browser/profiles/profile_info_cache.h" |
27 #include "chrome/browser/profiles/profile_metrics.h" | 28 #include "chrome/browser/profiles/profile_metrics.h" |
| 29 #include "chrome/browser/profiles/startup_task_runner_service.h" |
| 30 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" |
28 #include "chrome/browser/sync/profile_sync_service.h" | 31 #include "chrome/browser/sync/profile_sync_service.h" |
29 #include "chrome/browser/sync/profile_sync_service_factory.h" | 32 #include "chrome/browser/sync/profile_sync_service_factory.h" |
30 #include "chrome/browser/ui/browser.h" | 33 #include "chrome/browser/ui/browser.h" |
31 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" | 34 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
32 #include "chrome/common/chrome_constants.h" | 35 #include "chrome/common/chrome_constants.h" |
33 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
34 #include "chrome/common/chrome_paths_internal.h" | 37 #include "chrome/common/chrome_paths_internal.h" |
35 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
36 #include "chrome/common/logging_chrome.h" | 39 #include "chrome/common/logging_chrome.h" |
37 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 extensions::ExtensionSystem::Get(profile)->extension_service()); | 757 extensions::ExtensionSystem::Get(profile)->extension_service()); |
755 } | 758 } |
756 } | 759 } |
757 #endif | 760 #endif |
758 #if defined(ENABLE_MANAGED_USERS) | 761 #if defined(ENABLE_MANAGED_USERS) |
759 // Initialization needs to happen after extension system initialization (for | 762 // Initialization needs to happen after extension system initialization (for |
760 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the | 763 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the |
761 // initializing the managed flag if necessary). | 764 // initializing the managed flag if necessary). |
762 ManagedUserServiceFactory::GetForProfile(profile)->Init(); | 765 ManagedUserServiceFactory::GetForProfile(profile)->Init(); |
763 #endif | 766 #endif |
| 767 // Start the deferred task runners once the profile is loaded. |
| 768 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> |
| 769 StartDeferredTaskRunners(); |
764 } | 770 } |
765 | 771 |
766 void ProfileManager::DoFinalInitLogging(Profile* profile) { | 772 void ProfileManager::DoFinalInitLogging(Profile* profile) { |
767 // Count number of extensions in this profile. | 773 // Count number of extensions in this profile. |
768 int extension_count = -1; | 774 int extension_count = -1; |
769 #if defined(ENABLE_EXTENSIONS) | 775 #if defined(ENABLE_EXTENSIONS) |
770 ExtensionService* extension_service = profile->GetExtensionService(); | 776 ExtensionService* extension_service = profile->GetExtensionService(); |
771 if (extension_service) | 777 if (extension_service) |
772 extension_count = extension_service->GetAppIds().size(); | 778 extension_count = extension_service->GetAppIds().size(); |
773 #endif | 779 #endif |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 ProfileManager::ProfileInfo::ProfileInfo( | 1116 ProfileManager::ProfileInfo::ProfileInfo( |
1111 Profile* profile, | 1117 Profile* profile, |
1112 bool created) | 1118 bool created) |
1113 : profile(profile), | 1119 : profile(profile), |
1114 created(created) { | 1120 created(created) { |
1115 } | 1121 } |
1116 | 1122 |
1117 ProfileManager::ProfileInfo::~ProfileInfo() { | 1123 ProfileManager::ProfileInfo::~ProfileInfo() { |
1118 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 1124 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
1119 } | 1125 } |
OLD | NEW |