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

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, 4 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
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 401cda05023307225aae7cff9be8bc125ff23c57..c7d9f17c7f8a7ba747ae59317b963a9ddc3dd412 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)
@@ -157,7 +158,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()),
Marc Treib 2016/08/31 09:26:16 You'll probably have to do the same thing in the i
sfiera 2016/08/31 10:09:16 Done, possibly.
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') | components/ntp_snippets/ntp_snippets_fetcher.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698