diff options
author | Mathieu Perreault <mathp@chromium.org> | 2015-07-23 14:16:03 -0400 |
---|---|---|
committer | Mathieu Perreault <mathp@chromium.org> | 2015-07-23 18:17:39 +0000 |
commit | de2db0b62e2ad61129bd48a991c4b38c9d03beeb (patch) | |
tree | 8af27351e2641b0d13f4697929199b1b9e02c70b | |
parent | 38016746e6bd76dde40dd5aca90fdddba8f62b77 (diff) | |
download | chromium_src-de2db0b62e2ad61129bd48a991c4b38c9d03beeb.zip chromium_src-de2db0b62e2ad61129bd48a991c4b38c9d03beeb.tar.gz chromium_src-de2db0b62e2ad61129bd48a991c4b38c9d03beeb.tar.bz2 |
[Autofill] Include Chrome Variations state in Autofill requests
The Chrome Variations headers are now included in the request to the Autofill server.
This will allow the server to vary functionality according to experiments.
BUG=512562
TEST=chrome://net-internals
Review URL: https://codereview.chromium.org/1250833002
(cherry picked from commit b8876092112eb6464e696e012c1a8596b559e522)
Cr-Original-Commit-Position: refs/heads/master@{#339898}
Cr-Commit-Position: refs/branch-heads/2454@{#110}
Cr-Branched-From: 12bfc3360892ec53cd00fc239a47e5298beb063b-refs/heads/master@{#338390}
-rw-r--r-- | components/autofill.gypi | 1 | ||||
-rw-r--r-- | components/autofill/core/browser/BUILD.gn | 1 | ||||
-rw-r--r-- | components/autofill/core/browser/autofill_download_manager.cc | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/components/autofill.gypi b/components/autofill.gypi index 99cc85d..bfac495 100644 --- a/components/autofill.gypi +++ b/components/autofill.gypi @@ -92,6 +92,7 @@ 'rappor', 'signin_core_browser', 'signin_core_common', + 'variations_http_provider', 'webdata_common', ], 'sources': [ diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn index 28e57a8..143aebe 100644 --- a/components/autofill/core/browser/BUILD.gn +++ b/components/autofill/core/browser/BUILD.gn @@ -151,6 +151,7 @@ static_library("browser") { "//components/signin/core/common", "//components/strings", "//components/sync_driver", + "//components/variations/net", "//components/webdata/common", "//google_apis", "//net", diff --git a/components/autofill/core/browser/autofill_download_manager.cc b/components/autofill/core/browser/autofill_download_manager.cc index efcabc7..63a7744 100644 --- a/components/autofill/core/browser/autofill_download_manager.cc +++ b/components/autofill/core/browser/autofill_download_manager.cc @@ -14,7 +14,9 @@ #include "components/autofill/core/browser/autofill_xml_parser.h" #include "components/autofill/core/browser/form_structure.h" #include "components/autofill/core/common/autofill_pref_names.h" +#include "components/variations/net/variations_http_header_provider.h" #include "net/base/load_flags.h" +#include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_fetcher.h" #include "third_party/webrtc/libjingle/xmllite/xmlparser.h" @@ -186,6 +188,11 @@ bool AutofillDownloadManager::StartRequest( fetcher->SetUploadData("text/plain", form_xml); fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES); + // Add Chrome experiment state to the request headers. + net::HttpRequestHeaders headers; + variations::VariationsHttpHeaderProvider::GetInstance()->AppendHeaders( + fetcher->GetOriginalURL(), driver_->IsOffTheRecord(), false, &headers); + fetcher->SetExtraRequestHeaders(headers.ToString()); fetcher->Start(); VLOG(1) << "Sending AutofillDownloadManager " |