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

Unified Diff: ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc

Issue 2292053004: Inject API key directly into snippets fetcher. (Closed)
Patch Set: rebase Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
diff --git a/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc b/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
index 4ce446eff482d7fb29561b07ffa3d8dbb04b39c1..31da06c2dfbfc5beccd217f119b4d02c835c6269 100644
--- a/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
+++ b/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
@@ -26,6 +26,7 @@
#include "components/ntp_snippets/ntp_snippets_status_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/version_info/version_info.h"
+#include "google_apis/google_api_keys.h"
#include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
@@ -161,7 +162,9 @@ IOSChromeContentSuggestionsServiceFactory::BuildServiceInstanceFor(
base::MakeUnique<NTPSnippetsFetcher>(
signin_manager, token_service, request_context, prefs,
service->category_factory(), base::Bind(&ParseJson),
- GetChannel() == version_info::Channel::STABLE),
+ GetChannel() == version_info::Channel::STABLE
+ ? google_apis::GetAPIKey()
+ : google_apis::GetNonStableAPIKey()),
base::MakeUnique<ImageFetcherImpl>(
request_context.get(), web::WebThread::GetBlockingPool()),
base::MakeUnique<IOSImageDecoderImpl>(),
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698