Send variations seed version to UMA.

Update variations_seed proto and metrics protos, and send seed versions
to UMA, so it's available for analysis.

Change-Id: Id2954646c6c000af8accde3e43f1eedc9e5c1c1f
Reviewed-on: https://chromium-review.googlesource.com/c/1339242
Reviewed-by: Alexei Svitkine <[email protected]>
Commit-Queue: Steven Holte <[email protected]>
Cr-Commit-Position: refs/heads/master@{#610188}
diff --git a/components/variations/active_field_trials.cc b/components/variations/active_field_trials.cc
index f18dfe1..ae0fb9fd 100644
--- a/components/variations/active_field_trials.cc
+++ b/components/variations/active_field_trials.cc
@@ -8,6 +8,7 @@
 
 #include <vector>
 
+#include "base/lazy_instance.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "components/variations/hashing.h"
@@ -17,6 +18,8 @@
 
 namespace {
 
+base::LazyInstance<std::string>::Leaky g_seed_version;
+
 // Populates |name_group_ids| based on |active_groups|. Field trial names are
 // suffixed with |suffix| before hashing is executed.
 void GetFieldTrialActiveGroupIdsForActiveGroups(
@@ -77,6 +80,14 @@
   AppendActiveGroupIdsAsStrings(name_group_ids, output);
 }
 
+void SetSeedVersion(const std::string& seed_version) {
+  g_seed_version.Get() = seed_version;
+}
+
+const std::string& GetSeedVersion() {
+  return g_seed_version.Get();
+}
+
 namespace testing {
 
 void TestGetFieldTrialActiveGroupIds(