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

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

Issue 2395123002: Connecting UserClassifier to NtpSnippetsFetcher (Closed)
Patch Set: Rebase 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
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 bool is_stable_channel = 145 bool is_stable_channel =
146 chrome::GetChannel() == version_info::Channel::STABLE; 146 chrome::GetChannel() == version_info::Channel::STABLE;
147 auto provider = base::MakeUnique<NTPSnippetsService>( 147 auto provider = base::MakeUnique<NTPSnippetsService>(
148 service, service->category_factory(), pref_service, 148 service, service->category_factory(), pref_service,
149 g_browser_process->GetApplicationLocale(), service->user_classifier(), 149 g_browser_process->GetApplicationLocale(), service->user_classifier(),
150 scheduler, 150 scheduler,
151 base::MakeUnique<NTPSnippetsFetcher>( 151 base::MakeUnique<NTPSnippetsFetcher>(
152 signin_manager, token_service, request_context, pref_service, 152 signin_manager, token_service, request_context, pref_service,
153 category_factory, base::Bind(&safe_json::SafeJsonParser::Parse), 153 category_factory, base::Bind(&safe_json::SafeJsonParser::Parse),
154 is_stable_channel ? google_apis::GetAPIKey() 154 is_stable_channel ? google_apis::GetAPIKey()
155 : google_apis::GetNonStableAPIKey()), 155 : google_apis::GetNonStableAPIKey(),
156 service->user_classifier()),
156 base::MakeUnique<ImageFetcherImpl>(base::MakeUnique<ImageDecoderImpl>(), 157 base::MakeUnique<ImageFetcherImpl>(base::MakeUnique<ImageDecoderImpl>(),
157 request_context.get()), 158 request_context.get()),
158 base::MakeUnique<ImageDecoderImpl>(), 159 base::MakeUnique<ImageDecoderImpl>(),
159 base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner), 160 base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner),
160 base::MakeUnique<NTPSnippetsStatusService>(signin_manager, pref_service)); 161 base::MakeUnique<NTPSnippetsStatusService>(signin_manager, pref_service));
161 service->set_ntp_snippets_service(provider.get()); 162 service->set_ntp_snippets_service(provider.get());
162 service->RegisterProvider(std::move(provider)); 163 service->RegisterProvider(std::move(provider));
163 } 164 }
164 165
165 void RegisterForeignSessionsProvider(SyncService* sync_service, 166 void RegisterForeignSessionsProvider(SyncService* sync_service,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 279 }
279 280
280 if (base::FeatureList::IsEnabled( 281 if (base::FeatureList::IsEnabled(
281 ntp_snippets::kForeignSessionsSuggestionsFeature)) { 282 ntp_snippets::kForeignSessionsSuggestionsFeature)) {
282 RegisterForeignSessionsProvider(sync_service, service, category_factory, 283 RegisterForeignSessionsProvider(sync_service, service, category_factory,
283 pref_service); 284 pref_service);
284 } 285 }
285 286
286 return service; 287 return service;
287 } 288 }
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/remote/ntp_snippets_fetcher.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698