OLD | NEW |
---|---|
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 Loading... | |
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, suggestions_service, | 152 service, service->category_factory(), pref_service, suggestions_service, |
153 g_browser_process->GetApplicationLocale(), service->user_classifier(), | 153 g_browser_process->GetApplicationLocale(), service->user_classifier(), |
154 scheduler, | 154 scheduler, |
155 base::MakeUnique<NTPSnippetsFetcher>( | 155 base::MakeUnique<NTPSnippetsFetcher>( |
156 signin_manager, token_service, request_context, pref_service, | 156 signin_manager, token_service, request_context, pref_service, |
157 category_factory, base::Bind(&safe_json::SafeJsonParser::Parse), | 157 category_factory, 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()), | |
Marc Treib
2016/10/06 13:41:54
You'll also have to do this for ios.
jkrcal
2016/10/06 14:45:58
Thanks! Done.
| |
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 Loading... | |
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 } |
OLD | NEW |