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

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

Issue 2190583002: Add bookmark provider for content suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments #2 Created 4 years, 4 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>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 #endif 100 #endif
101 101
102 #if defined(ENABLE_SUPERVISED_USERS) 102 #if defined(ENABLE_SUPERVISED_USERS)
103 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" 103 #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" 104 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa ctory.h"
105 #include "chrome/browser/supervised_user/supervised_user_service.h" 105 #include "chrome/browser/supervised_user/supervised_user_service.h"
106 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" 106 #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
107 #endif 107 #endif
108 108
109 #if defined(OS_ANDROID) 109 #if defined(OS_ANDROID)
110 #include "chrome/browser/android/ntp/bookmark_suggestions_provider_factory.h"
110 #include "chrome/browser/android/ntp/offline_page_suggestions_provider_factory.h " 111 #include "chrome/browser/android/ntp/offline_page_suggestions_provider_factory.h "
111 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" 112 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
112 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h" 113 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h"
113 #endif 114 #endif
114 115
115 #if defined(OS_CHROMEOS) 116 #if defined(OS_CHROMEOS)
116 #include "chrome/browser/browser_process_platform_part_chromeos.h" 117 #include "chrome/browser/browser_process_platform_part_chromeos.h"
117 #include "chrome/browser/chromeos/profiles/profile_helper.h" 118 #include "chrome/browser/chromeos/profiles/profile_helper.h"
118 #include "chromeos/chromeos_switches.h" 119 #include "chromeos/chromeos_switches.h"
119 #include "chromeos/dbus/cryptohome_client.h" 120 #include "chromeos/dbus/cryptohome_client.h"
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 1221
1221 // Service is responsible for migration of the legacy password manager 1222 // Service is responsible for migration of the legacy password manager
1222 // preference which controls behaviour of the Chrome to the new preference 1223 // preference which controls behaviour of the Chrome to the new preference
1223 // which controls password management behaviour on Chrome and Android. After 1224 // which controls password management behaviour on Chrome and Android. After
1224 // migration will be performed for all users it's planned to remove the 1225 // migration will be performed for all users it's planned to remove the
1225 // migration code, rough time estimates are Q1 2016. 1226 // migration code, rough time estimates are Q1 2016.
1226 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile) 1227 PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile)
1227 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile)); 1228 ->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile));
1228 1229
1229 #if defined(OS_ANDROID) 1230 #if defined(OS_ANDROID)
1230 // Service is responsible for fetching content snippets for the NTP. 1231 // TODO(pke): Remove all these initializer lines.
1232 // Do not add any more suggestion provider initializers. This is not the place
1233 // where every single profile-keyed service should be initialized. By default,
1234 // profile-keyed services are lazily created when needed. If there is
1235 // something that needs to happen at startup (like scheduling the fetching
1236 // task), the factory can declare that it wants to be created with the
1237 // profile. If we want to only add some providers under certain conditions, we
1238 // can move the provider registration code e.g. to the
1239 // ContentSuggestionsFactory, which would have the advantage that it would
1240 // centralize it. Service is responsible for fetching content snippets for the
1241 // NTP.
1231 ContentSuggestionsServiceFactory::GetForProfile(profile); 1242 ContentSuggestionsServiceFactory::GetForProfile(profile);
1232 NTPSnippetsServiceFactory::GetForProfile(profile); 1243 NTPSnippetsServiceFactory::GetForProfile(profile);
1233 OfflinePageSuggestionsProviderFactory::GetForProfile(profile); 1244 OfflinePageSuggestionsProviderFactory::GetForProfile(profile);
1245 BookmarkSuggestionsProviderFactory::GetForProfile(profile);
1234 #endif 1246 #endif
1235 } 1247 }
1236 1248
1237 void ProfileManager::DoFinalInitLogging(Profile* profile) { 1249 void ProfileManager::DoFinalInitLogging(Profile* profile) {
1238 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitLogging"); 1250 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitLogging");
1239 // Count number of extensions in this profile. 1251 // Count number of extensions in this profile.
1240 int enabled_app_count = -1; 1252 int enabled_app_count = -1;
1241 #if defined(ENABLE_EXTENSIONS) 1253 #if defined(ENABLE_EXTENSIONS)
1242 enabled_app_count = GetEnabledAppCount(profile); 1254 enabled_app_count = GetEnabledAppCount(profile);
1243 #endif 1255 #endif
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 1643
1632 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); 1644 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path);
1633 if (!original_callback.is_null()) 1645 if (!original_callback.is_null())
1634 original_callback.Run(loaded_profile, status); 1646 original_callback.Run(loaded_profile, status);
1635 } 1647 }
1636 #endif // !defined(OS_ANDROID) 1648 #endif // !defined(OS_ANDROID)
1637 1649
1638 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1650 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1639 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1651 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1640 } 1652 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698