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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 #include "extensions/common/manifest.h" | 100 #include "extensions/common/manifest.h" |
100 #endif | 101 #endif |
101 | 102 |
102 #if defined(ENABLE_SUPERVISED_USERS) | 103 #if defined(ENABLE_SUPERVISED_USERS) |
103 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" | 104 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" |
104 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa
ctory.h" | 105 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa
ctory.h" |
105 #include "chrome/browser/supervised_user/supervised_user_service.h" | 106 #include "chrome/browser/supervised_user/supervised_user_service.h" |
106 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 107 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
107 #endif | 108 #endif |
108 | 109 |
109 #if defined(OS_WIN) | 110 #if defined(OS_ANDROID) |
110 #include "chrome/installer/util/browser_distribution.h" | 111 #include "chrome/browser/android/chrome_feature_list.h" |
| 112 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h" |
| 113 #include "components/ntp_snippets/ntp_snippets_service.h" |
111 #endif | 114 #endif |
112 | 115 |
113 #if defined(OS_CHROMEOS) | 116 #if defined(OS_CHROMEOS) |
114 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 117 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
115 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 118 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
116 #include "chromeos/chromeos_switches.h" | 119 #include "chromeos/chromeos_switches.h" |
117 #include "chromeos/dbus/cryptohome_client.h" | 120 #include "chromeos/dbus/cryptohome_client.h" |
118 #include "chromeos/dbus/dbus_thread_manager.h" | 121 #include "chromeos/dbus/dbus_thread_manager.h" |
119 #include "components/user_manager/user.h" | 122 #include "components/user_manager/user.h" |
120 #include "components/user_manager/user_manager.h" | 123 #include "components/user_manager/user_manager.h" |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 ->SetupInvalidationsOnProfileLoad(invalidation_service); | 1146 ->SetupInvalidationsOnProfileLoad(invalidation_service); |
1144 AccountReconcilorFactory::GetForProfile(profile); | 1147 AccountReconcilorFactory::GetForProfile(profile); |
1145 | 1148 |
1146 // Service is responsible for migration of the legacy password manager | 1149 // Service is responsible for migration of the legacy password manager |
1147 // preference which controls behaviour of the Chrome to the new preference | 1150 // preference which controls behaviour of the Chrome to the new preference |
1148 // which controls password management behaviour on Chrome and Android. After | 1151 // which controls password management behaviour on Chrome and Android. After |
1149 // migration will be performed for all users it's planned to remove the | 1152 // migration will be performed for all users it's planned to remove the |
1150 // migration code, rough time estimates are Q1 2016. | 1153 // migration code, rough time estimates are Q1 2016. |
1151 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile) | 1154 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile) |
1152 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile)); | 1155 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile)); |
| 1156 |
| 1157 #if defined(OS_ANDROID) |
| 1158 // Service is responsible for fetching content snippets for the NTP. |
| 1159 // Note: Create the service even if the feature is disabled, so that any |
| 1160 // remaining tasks will be cleaned up. |
| 1161 NTPSnippetsServiceFactory::GetForProfile(profile)->Init( |
| 1162 base::FeatureList::IsEnabled(chrome::android::kNTPSnippetsFeature)); |
| 1163 #endif |
1153 } | 1164 } |
1154 | 1165 |
1155 void ProfileManager::DoFinalInitLogging(Profile* profile) { | 1166 void ProfileManager::DoFinalInitLogging(Profile* profile) { |
1156 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitLogging"); | 1167 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitLogging"); |
1157 // Count number of extensions in this profile. | 1168 // Count number of extensions in this profile. |
1158 int enabled_app_count = -1; | 1169 int enabled_app_count = -1; |
1159 #if defined(ENABLE_EXTENSIONS) | 1170 #if defined(ENABLE_EXTENSIONS) |
1160 enabled_app_count = GetEnabledAppCount(profile); | 1171 enabled_app_count = GetEnabledAppCount(profile); |
1161 #endif | 1172 #endif |
1162 | 1173 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 | 1555 |
1545 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); | 1556 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); |
1546 if (!original_callback.is_null()) | 1557 if (!original_callback.is_null()) |
1547 original_callback.Run(loaded_profile, status); | 1558 original_callback.Run(loaded_profile, status); |
1548 } | 1559 } |
1549 #endif // !defined(OS_ANDROID) | 1560 #endif // !defined(OS_ANDROID) |
1550 | 1561 |
1551 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1562 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1552 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1563 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1553 } | 1564 } |
OLD | NEW |