Refactor VariationsHttpHeaderProvider.

The goal is to move the bulk of its implementation to the main
variations component, so that it can be used by this CL from JNI:
https://codereview.chromium.org/1528543003/

Creates variations_http_headers.cc in net that still needs to depend
on net, which uses the http header provider internally. Updates
callers of the previous API to use the new simpler API that doesn't
require going through the singleton by clients.

Additionally, also adds variations/synthetic_trials.h and moves
the synthetic trials structs from metrics_service.h to the new
file. This works around an otherwise circular dependency between
metrics and variations, since variations_http_header_provider.cc
depends on synthetic trials.

TBRs below are for owners of downstream users of the API which
is being updated.

BUG=530223
[email protected],[email protected]

Review URL: https://codereview.chromium.org/1530133005

Cr-Commit-Position: refs/heads/master@{#365991}
diff --git a/components/variations/net/variations_http_headers.h b/components/variations/net/variations_http_headers.h
new file mode 100644
index 0000000..d6280e5
--- /dev/null
+++ b/components/variations/net/variations_http_headers.h
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_VARIATIONS_NET_VARIATIONS_HTTP_HEADERS_H_
+#define COMPONENTS_VARIATIONS_NET_VARIATIONS_HTTP_HEADERS_H_
+
+#include <set>
+#include <string>
+
+namespace net {
+class HttpRequestHeaders;
+}
+
+class GURL;
+
+namespace variations {
+
+// Adds Chrome experiment and metrics state as custom headers to |headers|.
+// Some headers may not be set given the |incognito| mode or whether
+// the user has |uma_enabled|.  Also, we never transmit headers to non-Google
+// sites, which is checked based on the destination |url|.
+void AppendVariationHeaders(const GURL& url,
+                            bool incognito,
+                            bool uma_enabled,
+                            net::HttpRequestHeaders* headers);
+
+// Returns the HTTP header names which are added by AppendVariationHeaders().
+std::set<std::string> GetVariationHeaderNames();
+
+namespace internal {
+
+// Checks whether variation headers should be appended to requests to the
+// specified |url|. Returns true for google.<TLD> and youtube.<TLD> URLs.
+bool ShouldAppendVariationHeaders(const GURL& url);
+
+}  // namespace internal
+
+}  // namespace variations
+
+#endif  // COMPONENTS_VARIATIONS_NET_VARIATIONS_HTTP_HEADERS_H_