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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/deferred_sequenced_task_runner.h" | 14 #include "base/deferred_sequenced_task_runner.h" |
| 15 #include "base/feature_list.h" | |
| 15 #include "base/files/file_enumerator.h" | 16 #include "base/files/file_enumerator.h" |
| 16 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 17 #include "base/files/file_util.h" | 18 #include "base/files/file_util.h" |
| 18 #include "base/metrics/histogram_macros.h" | 19 #include "base/metrics/histogram_macros.h" |
| 19 #include "base/profiler/scoped_profile.h" | 20 #include "base/profiler/scoped_profile.h" |
| 20 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/trace_event/trace_event.h" | 24 #include "base/trace_event/trace_event.h" |
| 24 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
| 118 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 119 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
| 119 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 120 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 120 #include "chromeos/chromeos_switches.h" | 121 #include "chromeos/chromeos_switches.h" |
| 121 #include "chromeos/dbus/cryptohome_client.h" | 122 #include "chromeos/dbus/cryptohome_client.h" |
| 122 #include "chromeos/dbus/dbus_thread_manager.h" | 123 #include "chromeos/dbus/dbus_thread_manager.h" |
| 123 #include "components/user_manager/user.h" | 124 #include "components/user_manager/user.h" |
| 124 #include "components/user_manager/user_manager.h" | 125 #include "components/user_manager/user_manager.h" |
| 125 #endif | 126 #endif |
| 126 | 127 |
| 128 #if defined(OS_ANDROID) | |
|
Bernhard Bauer
2016/02/16 16:19:08
Move this before the OS_IOS section, so the sectio
Marc Treib
2016/02/16 16:54:27
Sure, done. Also moved WIN behind CHROMEOS so it's
| |
| 129 #include "chrome/browser/android/chrome_feature_list.h" | |
| 130 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h" | |
| 131 #include "components/ntp_snippets/ntp_snippets_service.h" | |
| 132 #endif | |
| 133 | |
| 127 using base::UserMetricsAction; | 134 using base::UserMetricsAction; |
| 128 using content::BrowserThread; | 135 using content::BrowserThread; |
| 129 | 136 |
| 130 namespace { | 137 namespace { |
| 131 | 138 |
| 132 // Profiles that should be deleted on shutdown. | 139 // Profiles that should be deleted on shutdown. |
| 133 std::vector<base::FilePath>& ProfilesToDelete() { | 140 std::vector<base::FilePath>& ProfilesToDelete() { |
| 134 CR_DEFINE_STATIC_LOCAL(std::vector<base::FilePath>, profiles_to_delete, ()); | 141 CR_DEFINE_STATIC_LOCAL(std::vector<base::FilePath>, profiles_to_delete, ()); |
| 135 return profiles_to_delete; | 142 return profiles_to_delete; |
| 136 } | 143 } |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1147 ->SetupInvalidationsOnProfileLoad(invalidation_service); | 1154 ->SetupInvalidationsOnProfileLoad(invalidation_service); |
| 1148 AccountReconcilorFactory::GetForProfile(profile); | 1155 AccountReconcilorFactory::GetForProfile(profile); |
| 1149 | 1156 |
| 1150 // Service is responsible for migration of the legacy password manager | 1157 // Service is responsible for migration of the legacy password manager |
| 1151 // preference which controls behaviour of the Chrome to the new preference | 1158 // preference which controls behaviour of the Chrome to the new preference |
| 1152 // which controls password management behaviour on Chrome and Android. After | 1159 // which controls password management behaviour on Chrome and Android. After |
| 1153 // migration will be performed for all users it's planned to remove the | 1160 // migration will be performed for all users it's planned to remove the |
| 1154 // migration code, rough time estimates are Q1 2016. | 1161 // migration code, rough time estimates are Q1 2016. |
| 1155 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile) | 1162 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile) |
| 1156 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile)); | 1163 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile)); |
| 1164 | |
| 1165 #if defined(OS_ANDROID) | |
| 1166 // Service is responsible for fetching content snippets for the NTP. | |
| 1167 // Note: Create the service even if the feature is disabled, so that any | |
| 1168 // remaining tasks will be cleaned up. | |
| 1169 NTPSnippetsServiceFactory::GetForProfile(profile)->Init( | |
| 1170 base::FeatureList::IsEnabled(chrome::android::kNTPSnippetsFeature)); | |
| 1171 #endif | |
| 1157 } | 1172 } |
| 1158 | 1173 |
| 1159 void ProfileManager::DoFinalInitLogging(Profile* profile) { | 1174 void ProfileManager::DoFinalInitLogging(Profile* profile) { |
| 1160 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitLogging"); | 1175 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitLogging"); |
| 1161 // Count number of extensions in this profile. | 1176 // Count number of extensions in this profile. |
| 1162 int enabled_app_count = -1; | 1177 int enabled_app_count = -1; |
| 1163 #if defined(ENABLE_EXTENSIONS) | 1178 #if defined(ENABLE_EXTENSIONS) |
| 1164 enabled_app_count = GetEnabledAppCount(profile); | 1179 enabled_app_count = GetEnabledAppCount(profile); |
| 1165 #endif | 1180 #endif |
| 1166 | 1181 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1548 | 1563 |
| 1549 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); | 1564 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); |
| 1550 if (!original_callback.is_null()) | 1565 if (!original_callback.is_null()) |
| 1551 original_callback.Run(loaded_profile, status); | 1566 original_callback.Run(loaded_profile, status); |
| 1552 } | 1567 } |
| 1553 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 1568 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
| 1554 | 1569 |
| 1555 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1570 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1556 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1571 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1557 } | 1572 } |
| OLD | NEW |