Chromium Code Reviews| 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" |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/deferred_sequenced_task_runner.h" | 12 #include "base/deferred_sequenced_task_runner.h" |
| 13 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
| 18 #include "base/prefs/scoped_user_pref_update.h" | 18 #include "base/prefs/scoped_user_pref_update.h" |
| 19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| 21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
| 22 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 22 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 24 #include "chrome/browser/chrome_notification_types.h" | 24 #include "chrome/browser/chrome_notification_types.h" |
| 25 #include "chrome/browser/content_settings/host_content_settings_map.h" | 25 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 26 #include "chrome/browser/download/download_service.h" | 26 #include "chrome/browser/download/download_service.h" |
| 27 #include "chrome/browser/download/download_service_factory.h" | 27 #include "chrome/browser/download/download_service_factory.h" |
| 28 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | |
| 29 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h" | |
| 28 #include "chrome/browser/password_manager/password_store_factory.h" | 30 #include "chrome/browser/password_manager/password_store_factory.h" |
| 29 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 31 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 30 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" | 32 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
| 31 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 33 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 32 #include "chrome/browser/profiles/profile_destroyer.h" | 34 #include "chrome/browser/profiles/profile_destroyer.h" |
| 33 #include "chrome/browser/profiles/profile_info_cache.h" | 35 #include "chrome/browser/profiles/profile_info_cache.h" |
| 34 #include "chrome/browser/profiles/profile_metrics.h" | 36 #include "chrome/browser/profiles/profile_metrics.h" |
| 35 #include "chrome/browser/profiles/profiles_state.h" | 37 #include "chrome/browser/profiles/profiles_state.h" |
| 36 #include "chrome/browser/profiles/startup_task_runner_service.h" | 38 #include "chrome/browser/profiles/startup_task_runner_service.h" |
| 37 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" | 39 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1003 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_ANDROID) | 1005 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_ANDROID) |
| 1004 // Initialization needs to happen after extension system initialization (for | 1006 // Initialization needs to happen after extension system initialization (for |
| 1005 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the | 1007 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the |
| 1006 // initializing the supervised flag if necessary). | 1008 // initializing the supervised flag if necessary). |
| 1007 SupervisedUserServiceFactory::GetForProfile(profile)->Init(); | 1009 SupervisedUserServiceFactory::GetForProfile(profile)->Init(); |
| 1008 #endif | 1010 #endif |
| 1009 // Start the deferred task runners once the profile is loaded. | 1011 // Start the deferred task runners once the profile is loaded. |
| 1010 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> | 1012 StartupTaskRunnerServiceFactory::GetForProfile(profile)-> |
| 1011 StartDeferredTaskRunners(); | 1013 StartDeferredTaskRunners(); |
| 1012 | 1014 |
| 1015 // Activate data reduction proxy. This creates a request context and makes a | |
| 1016 // URL request to check if the data reduction proxy server is reachable. | |
| 1017 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile)-> | |
|
rpetterson
2014/10/23 19:57:04
Is there any risk of this call slowing down startu
Not at Google. Contact bengr
2014/10/23 20:08:50
This call is simply being moved from profile_impl.
| |
| 1018 MaybeActivateDataReductionProxy(true); | |
| 1019 | |
| 1013 AccountTrackerServiceFactory::GetForProfile(profile); | 1020 AccountTrackerServiceFactory::GetForProfile(profile); |
| 1014 AccountReconcilorFactory::GetForProfile(profile); | 1021 AccountReconcilorFactory::GetForProfile(profile); |
| 1015 } | 1022 } |
| 1016 | 1023 |
| 1017 void ProfileManager::DoFinalInitLogging(Profile* profile) { | 1024 void ProfileManager::DoFinalInitLogging(Profile* profile) { |
| 1018 // Count number of extensions in this profile. | 1025 // Count number of extensions in this profile. |
| 1019 int enabled_app_count = -1; | 1026 int enabled_app_count = -1; |
| 1020 #if defined(ENABLE_EXTENSIONS) | 1027 #if defined(ENABLE_EXTENSIONS) |
| 1021 enabled_app_count = GetEnabledAppCount(profile); | 1028 enabled_app_count = GetEnabledAppCount(profile); |
| 1022 #endif | 1029 #endif |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1321 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1328 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
| 1322 FinishDeletingProfile(profile_to_delete_path); | 1329 FinishDeletingProfile(profile_to_delete_path); |
| 1323 } | 1330 } |
| 1324 } | 1331 } |
| 1325 } | 1332 } |
| 1326 #endif | 1333 #endif |
| 1327 | 1334 |
| 1328 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1335 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1329 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1336 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1330 } | 1337 } |
| OLD | NEW |