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

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

Issue 2395123002: Connecting UserClassifier to NtpSnippetsFetcher (Closed)
Patch Set: Unit-test fix Created 4 years, 2 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/remote/ntp_snippets_fetcher.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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 bool is_stable_channel = 149 bool is_stable_channel =
150 chrome::GetChannel() == version_info::Channel::STABLE; 150 chrome::GetChannel() == version_info::Channel::STABLE;
151 auto provider = base::MakeUnique<NTPSnippetsService>( 151 auto provider = base::MakeUnique<NTPSnippetsService>(
152 service, service->category_factory(), pref_service, 152 service, service->category_factory(), pref_service,
153 g_browser_process->GetApplicationLocale(), service->user_classifier(), 153 g_browser_process->GetApplicationLocale(), service->user_classifier(),
154 scheduler, base::MakeUnique<NTPSnippetsFetcher>( 154 scheduler, base::MakeUnique<NTPSnippetsFetcher>(
155 signin_manager, token_service, request_context, 155 signin_manager, token_service, request_context,
156 pref_service, category_factory, language_model, 156 pref_service, category_factory, language_model,
157 base::Bind(&safe_json::SafeJsonParser::Parse), 157 base::Bind(&safe_json::SafeJsonParser::Parse),
158 is_stable_channel ? google_apis::GetAPIKey() 158 is_stable_channel ? google_apis::GetAPIKey()
159 : google_apis::GetNonStableAPIKey()), 159 : google_apis::GetNonStableAPIKey(),
160 service->user_classifier()),
160 base::MakeUnique<ImageFetcherImpl>(base::MakeUnique<ImageDecoderImpl>(), 161 base::MakeUnique<ImageFetcherImpl>(base::MakeUnique<ImageDecoderImpl>(),
161 request_context.get()), 162 request_context.get()),
162 base::MakeUnique<ImageDecoderImpl>(), 163 base::MakeUnique<ImageDecoderImpl>(),
163 base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner), 164 base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner),
164 base::MakeUnique<NTPSnippetsStatusService>(signin_manager, pref_service)); 165 base::MakeUnique<NTPSnippetsStatusService>(signin_manager, pref_service));
165 service->set_ntp_snippets_service(provider.get()); 166 service->set_ntp_snippets_service(provider.get());
166 service->RegisterProvider(std::move(provider)); 167 service->RegisterProvider(std::move(provider));
167 } 168 }
168 169
169 void RegisterForeignSessionsProvider(SyncService* sync_service, 170 void RegisterForeignSessionsProvider(SyncService* sync_service,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 286 }
286 287
287 if (base::FeatureList::IsEnabled( 288 if (base::FeatureList::IsEnabled(
288 ntp_snippets::kForeignSessionsSuggestionsFeature)) { 289 ntp_snippets::kForeignSessionsSuggestionsFeature)) {
289 RegisterForeignSessionsProvider(sync_service, service, category_factory, 290 RegisterForeignSessionsProvider(sync_service, service, category_factory,
290 pref_service); 291 pref_service);
291 } 292 }
292 293
293 return service; 294 return service;
294 } 295 }
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/remote/ntp_snippets_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698