| 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/profiles/profile_manager.h" | 5 #include "chrome/browser/profiles/profile_manager.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/chrome_notification_types.h" | 26 #include "chrome/browser/chrome_notification_types.h" |
| 27 #include "chrome/browser/content_settings/host_content_settings_map.h" | 27 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 28 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 28 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 29 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" | 29 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
| 30 #include "chrome/browser/profiles/profile_destroyer.h" | 30 #include "chrome/browser/profiles/profile_destroyer.h" |
| 31 #include "chrome/browser/profiles/profile_info_cache.h" | 31 #include "chrome/browser/profiles/profile_info_cache.h" |
| 32 #include "chrome/browser/profiles/profile_metrics.h" | 32 #include "chrome/browser/profiles/profile_metrics.h" |
| 33 #include "chrome/browser/profiles/profiles_state.h" | 33 #include "chrome/browser/profiles/profiles_state.h" |
| 34 #include "chrome/browser/profiles/startup_task_runner_service.h" | 34 #include "chrome/browser/profiles/startup_task_runner_service.h" |
| 35 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" | 35 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" |
| 36 #include "chrome/browser/signin/account_reconcilor_factory.h" |
| 36 #include "chrome/browser/sync/profile_sync_service.h" | 37 #include "chrome/browser/sync/profile_sync_service.h" |
| 37 #include "chrome/browser/sync/profile_sync_service_factory.h" | 38 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 38 #include "chrome/browser/ui/browser.h" | 39 #include "chrome/browser/ui/browser.h" |
| 39 #include "chrome/browser/ui/browser_iterator.h" | 40 #include "chrome/browser/ui/browser_iterator.h" |
| 40 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 41 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
| 41 #include "chrome/common/chrome_constants.h" | 42 #include "chrome/common/chrome_constants.h" |
| 42 #include "chrome/common/chrome_paths_internal.h" | 43 #include "chrome/common/chrome_paths_internal.h" |
| 43 #include "chrome/common/chrome_switches.h" | 44 #include "chrome/common/chrome_switches.h" |
| 44 #include "chrome/common/logging_chrome.h" | 45 #include "chrome/common/logging_chrome.h" |
| 45 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 #endif | 799 #endif |
| 799 #if defined(ENABLE_MANAGED_USERS) | 800 #if defined(ENABLE_MANAGED_USERS) |
| 800 // Initialization needs to happen after extension system initialization (for | 801 // Initialization needs to happen after extension system initialization (for |
| 801 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the | 802 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the |
| 802 // initializing the managed flag if necessary). | 803 // initializing the managed flag if necessary). |
| 803 ManagedUserServiceFactory::GetForProfile(profile)->Init(); | 804 ManagedUserServiceFactory::GetForProfile(profile)->Init(); |
| 804 #endif | 805 #endif |
| 805 // Start the deferred task runners once the profile is loaded. | 806 // Start the deferred task runners once the profile is loaded. |
| 806 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> | 807 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> |
| 807 StartDeferredTaskRunners(); | 808 StartDeferredTaskRunners(); |
| 809 |
| 810 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 811 switches::kNewProfileManagement)) { |
| 812 AccountReconcilorFactory::GetForProfile(profile); |
| 813 } |
| 808 } | 814 } |
| 809 | 815 |
| 810 void ProfileManager::DoFinalInitLogging(Profile* profile) { | 816 void ProfileManager::DoFinalInitLogging(Profile* profile) { |
| 811 // Count number of extensions in this profile. | 817 // Count number of extensions in this profile. |
| 812 int extension_count = -1; | 818 int extension_count = -1; |
| 813 #if defined(ENABLE_EXTENSIONS) | 819 #if defined(ENABLE_EXTENSIONS) |
| 814 ExtensionService* extension_service = profile->GetExtensionService(); | 820 ExtensionService* extension_service = profile->GetExtensionService(); |
| 815 if (extension_service) | 821 if (extension_service) |
| 816 extension_count = extension_service->GetAppIds().size(); | 822 extension_count = extension_service->GetAppIds().size(); |
| 817 #endif | 823 #endif |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 ProfileManager::ProfileInfo::ProfileInfo( | 1218 ProfileManager::ProfileInfo::ProfileInfo( |
| 1213 Profile* profile, | 1219 Profile* profile, |
| 1214 bool created) | 1220 bool created) |
| 1215 : profile(profile), | 1221 : profile(profile), |
| 1216 created(created) { | 1222 created(created) { |
| 1217 } | 1223 } |
| 1218 | 1224 |
| 1219 ProfileManager::ProfileInfo::~ProfileInfo() { | 1225 ProfileManager::ProfileInfo::~ProfileInfo() { |
| 1220 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 1226 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
| 1221 } | 1227 } |
| OLD | NEW |