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

Side by Side Diff: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc

Issue 2611523004: [Background fetching] Background fetching when opening an NTP. (Closed)
Patch Set: Rebase Created 3 years, 11 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
« no previous file with comments | « no previous file | components/ntp_snippets/pref_names.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ntp_snippets/content_suggestions_service_factory.h" 5 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 pref_service)); 186 pref_service));
187 187
188 PersistentScheduler* scheduler = nullptr; 188 PersistentScheduler* scheduler = nullptr;
189 #if defined(OS_ANDROID) 189 #if defined(OS_ANDROID)
190 scheduler = NTPSnippetsLauncher::Get(); 190 scheduler = NTPSnippetsLauncher::Get();
191 #endif // OS_ANDROID 191 #endif // OS_ANDROID
192 192
193 auto scheduling_provider = 193 auto scheduling_provider =
194 base::MakeUnique<SchedulingRemoteSuggestionsProvider>( 194 base::MakeUnique<SchedulingRemoteSuggestionsProvider>(
195 service, std::move(provider), scheduler, service->user_classifier(), 195 service, std::move(provider), scheduler, service->user_classifier(),
196 pref_service); 196 pref_service, base::MakeUnique<base::DefaultClock>());
197 service->set_remote_suggestions_provider(scheduling_provider.get()); 197 service->set_remote_suggestions_provider(scheduling_provider.get());
198 service->set_remote_suggestions_scheduler(scheduling_provider.get()); 198 service->set_remote_suggestions_scheduler(scheduling_provider.get());
199 service->RegisterProvider(std::move(scheduling_provider)); 199 service->RegisterProvider(std::move(scheduling_provider));
200 } 200 }
201 201
202 void RegisterForeignSessionsProvider(SyncService* sync_service, 202 void RegisterForeignSessionsProvider(SyncService* sync_service,
203 ContentSuggestionsService* service, 203 ContentSuggestionsService* service,
204 PrefService* pref_service) { 204 PrefService* pref_service) {
205 std::unique_ptr<TabDelegateSyncAdapter> sync_adapter = 205 std::unique_ptr<TabDelegateSyncAdapter> sync_adapter =
206 base::MakeUnique<TabDelegateSyncAdapter>(sync_service); 206 base::MakeUnique<TabDelegateSyncAdapter>(sync_service);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 language_model, pref_service, profile); 329 language_model, pref_service, profile);
330 } 330 }
331 331
332 if (base::FeatureList::IsEnabled( 332 if (base::FeatureList::IsEnabled(
333 ntp_snippets::kForeignSessionsSuggestionsFeature)) { 333 ntp_snippets::kForeignSessionsSuggestionsFeature)) {
334 RegisterForeignSessionsProvider(sync_service, service, pref_service); 334 RegisterForeignSessionsProvider(sync_service, service, pref_service);
335 } 335 }
336 336
337 return service; 337 return service;
338 } 338 }
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698