Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 1699143002: [NTP Snippets] Schedule periodic fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_feature
Patch Set: noyau review Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 #include "extensions/common/manifest.h" 99 #include "extensions/common/manifest.h"
99 #endif 100 #endif
100 101
101 #if defined(ENABLE_SUPERVISED_USERS) 102 #if defined(ENABLE_SUPERVISED_USERS)
102 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" 103 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
103 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa ctory.h" 104 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa ctory.h"
104 #include "chrome/browser/supervised_user/supervised_user_service.h" 105 #include "chrome/browser/supervised_user/supervised_user_service.h"
105 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" 106 #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
106 #endif 107 #endif
107 108
109 #if defined(OS_ANDROID)
110 #include "chrome/browser/android/chrome_feature_list.h"
111 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h"
112 #include "components/ntp_snippets/ntp_snippets_service.h"
113 #endif
114
108 #if !defined(OS_IOS) 115 #if !defined(OS_IOS)
109 #include "chrome/browser/sessions/session_service_factory.h" 116 #include "chrome/browser/sessions/session_service_factory.h"
110 #include "chrome/browser/ui/browser_list.h" 117 #include "chrome/browser/ui/browser_list.h"
111 #endif // !defined (OS_IOS) 118 #endif // !defined (OS_IOS)
112 119
113 #if defined(OS_WIN)
114 #include "chrome/installer/util/browser_distribution.h"
115 #endif
116
117 #if defined(OS_CHROMEOS) 120 #if defined(OS_CHROMEOS)
118 #include "chrome/browser/browser_process_platform_part_chromeos.h" 121 #include "chrome/browser/browser_process_platform_part_chromeos.h"
119 #include "chrome/browser/chromeos/profiles/profile_helper.h" 122 #include "chrome/browser/chromeos/profiles/profile_helper.h"
120 #include "chromeos/chromeos_switches.h" 123 #include "chromeos/chromeos_switches.h"
121 #include "chromeos/dbus/cryptohome_client.h" 124 #include "chromeos/dbus/cryptohome_client.h"
122 #include "chromeos/dbus/dbus_thread_manager.h" 125 #include "chromeos/dbus/dbus_thread_manager.h"
123 #include "components/user_manager/user.h" 126 #include "components/user_manager/user.h"
124 #include "components/user_manager/user_manager.h" 127 #include "components/user_manager/user_manager.h"
125 #endif 128 #endif
126 129
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 ->SetupInvalidationsOnProfileLoad(invalidation_service); 1150 ->SetupInvalidationsOnProfileLoad(invalidation_service);
1148 AccountReconcilorFactory::GetForProfile(profile); 1151 AccountReconcilorFactory::GetForProfile(profile);
1149 1152
1150 // Service is responsible for migration of the legacy password manager 1153 // Service is responsible for migration of the legacy password manager
1151 // preference which controls behaviour of the Chrome to the new preference 1154 // preference which controls behaviour of the Chrome to the new preference
1152 // which controls password management behaviour on Chrome and Android. After 1155 // which controls password management behaviour on Chrome and Android. After
1153 // migration will be performed for all users it's planned to remove the 1156 // migration will be performed for all users it's planned to remove the
1154 // migration code, rough time estimates are Q1 2016. 1157 // migration code, rough time estimates are Q1 2016.
1155 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile) 1158 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile)
1156 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile)); 1159 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile));
1160
1161 #if defined(OS_ANDROID)
1162 // Service is responsible for fetching content snippets for the NTP.
1163 // Note: Create the service even if the feature is disabled, so that any
1164 // remaining tasks will be cleaned up.
1165 NTPSnippetsServiceFactory::GetForProfile(profile)->Init(
1166 base::FeatureList::IsEnabled(chrome::android::kNTPSnippetsFeature));
1167 #endif
1157 } 1168 }
1158 1169
1159 void ProfileManager::DoFinalInitLogging(Profile* profile) { 1170 void ProfileManager::DoFinalInitLogging(Profile* profile) {
1160 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitLogging"); 1171 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitLogging");
1161 // Count number of extensions in this profile. 1172 // Count number of extensions in this profile.
1162 int enabled_app_count = -1; 1173 int enabled_app_count = -1;
1163 #if defined(ENABLE_EXTENSIONS) 1174 #if defined(ENABLE_EXTENSIONS)
1164 enabled_app_count = GetEnabledAppCount(profile); 1175 enabled_app_count = GetEnabledAppCount(profile);
1165 #endif 1176 #endif
1166 1177
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 1559
1549 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); 1560 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path);
1550 if (!original_callback.is_null()) 1561 if (!original_callback.is_null())
1551 original_callback.Run(loaded_profile, status); 1562 original_callback.Run(loaded_profile, status);
1552 } 1563 }
1553 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) 1564 #endif // !defined(OS_ANDROID) && !defined(OS_IOS)
1554 1565
1555 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1566 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1556 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1567 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1557 } 1568 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698