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

Unified Diff: components/ntp_snippets/ntp_snippets_fetcher.cc

Issue 2168523003: Append variation headers when fetching snippets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_fetcher.cc
diff --git a/components/ntp_snippets/ntp_snippets_fetcher.cc b/components/ntp_snippets/ntp_snippets_fetcher.cc
index 0bf9f4a1c750450300e76f083f716aa280578cee..d0cb31ecac21dc1e117ccd277679ec8bead4aab7 100644
--- a/components/ntp_snippets/ntp_snippets_fetcher.cc
+++ b/components/ntp_snippets/ntp_snippets_fetcher.cc
@@ -25,6 +25,7 @@
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/browser/signin_manager_base.h"
+#include "components/variations/net/variations_http_headers.h"
#include "components/variations/variations_associated_data.h"
#include "google_apis/google_api_keys.h"
#include "net/base/load_flags.h"
@@ -335,6 +336,11 @@ void NTPSnippetsFetcher::FetchSnippetsImpl(const GURL& url,
if (!auth_header.empty())
headers.SetHeader("Authorization", auth_header);
headers.SetHeader("Content-Type", "application/json; charset=UTF-8");
+ // Add X-Client-Data header with experiment IDs from field trials.
+ variations::AppendVariationHeaders(url,
+ false, // incognito
+ false, // uma_enabled
+ &headers);
url_fetcher_->SetExtraRequestHeaders(headers.ToString());
url_fetcher_->SetUploadData("application/json", request);
// Log the request for debugging network issues.
« no previous file with comments | « components/ntp_snippets/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698