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

Unified Diff: chrome/browser/ntp_snippets/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 | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
diff --git a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
index bc220c2688477e507d7917b79c23c93f35abf711..3a7b08d220b623c20cc98d7c57d1bc6a6394e247 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -41,6 +41,7 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
+#include "google_apis/google_api_keys.h"
#include "net/url_request/url_request_context_getter.h"
#if defined(OS_ANDROID)
@@ -156,7 +157,8 @@ void RegisterArticleProvider(SigninManagerBase* signin_manager,
base::MakeUnique<NTPSnippetsFetcher>(
signin_manager, token_service, request_context, pref_service,
category_factory, base::Bind(&safe_json::SafeJsonParser::Parse),
- is_stable_channel),
+ is_stable_channel ? google_apis::GetAPIKey()
+ : google_apis::GetNonStableAPIKey()),
base::MakeUnique<ImageFetcherImpl>(
base::MakeUnique<ImageDecoderImpl>(), request_context.get()),
base::MakeUnique<ImageDecoderImpl>(),
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698