diff options
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_field_trial.cc | 23 | ||||
-rw-r--r-- | chrome/browser/instant/instant_field_trial.cc | 14 | ||||
-rw-r--r-- | chrome/common/metrics/variation_ids.h | 11 |
3 files changed, 44 insertions, 4 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_field_trial.cc b/chrome/browser/autocomplete/autocomplete_field_trial.cc index d262892..58fdeb8 100644 --- a/chrome/browser/autocomplete/autocomplete_field_trial.cc +++ b/chrome/browser/autocomplete/autocomplete_field_trial.cc @@ -7,8 +7,9 @@ #include <string> #include "base/metrics/field_trial.h" -#include "base/stringprintf.h" #include "base/string_number_conversions.h" +#include "chrome/common/metrics/experiments_helper.h" +#include "chrome/common/metrics/variation_ids.h" namespace { @@ -71,10 +72,24 @@ void AutocompleteFieldTrial::Activate() { "0", 2012, 10, 1, NULL)); if (base::FieldTrialList::IsOneTimeRandomizationEnabled()) trial->UseOneTimeRandomization(); + + // Mark this group in suggest requests to Google. + experiments_helper::AssociateGoogleExperimentID( + kSuggestFieldTrialName, "0", chrome_variations::kSuggestIDMin); + DCHECK_EQ(kSuggestFieldTrialNumberOfGroups, + chrome_variations::kSuggestIDMax - chrome_variations::kSuggestIDMin + 1); + // We've already created one group; now just need to create - // kSuggestFieldTrialNumGroups - 1 more. - for (int i = 1; i < kSuggestFieldTrialNumberOfGroups; i++) - trial->AppendGroup(base::StringPrintf("%d", i), 1); + // kSuggestFieldTrialNumGroups - 1 more. Mark these groups in + // suggest requests to Google. + for (int i = 1; i < kSuggestFieldTrialNumberOfGroups; i++) { + const std::string group_name = base::IntToString(i); + trial->AppendGroup(group_name, 1); + experiments_helper::AssociateGoogleExperimentID( + kSuggestFieldTrialName, group_name, + static_cast<chrome_variations::ID>( + chrome_variations::kSuggestIDMin + i)); + } } bool AutocompleteFieldTrial::InDisallowInlineHQPFieldTrial() { diff --git a/chrome/browser/instant/instant_field_trial.cc b/chrome/browser/instant/instant_field_trial.cc index dbb736f..20f3b90 100644 --- a/chrome/browser/instant/instant_field_trial.cc +++ b/chrome/browser/instant/instant_field_trial.cc @@ -10,6 +10,8 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/metrics/experiments_helper.h" +#include "chrome/common/metrics/variation_ids.h" #include "chrome/common/pref_names.h" namespace { @@ -40,6 +42,18 @@ void InstantFieldTrial::Activate() { g_suggest = trial->AppendGroup("SUGGEST", 200); // 20% g_hidden = trial->AppendGroup("HIDDEN", 200); // 20% g_silent = trial->AppendGroup("SILENT", 200); // 20% + + // Mark these groups in requests to Google. + experiments_helper::AssociateGoogleExperimentID( + "Instant", "CONTROL", chrome_variations::kInstantIDControl); + experiments_helper::AssociateGoogleExperimentID( + "Instant", "SILENT", chrome_variations::kInstantIDSilent); + experiments_helper::AssociateGoogleExperimentID( + "Instant", "HIDDEN", chrome_variations::kInstantIDHidden); + experiments_helper::AssociateGoogleExperimentID( + "Instant", "SUGGEST", chrome_variations::kInstantIDSuggest); + experiments_helper::AssociateGoogleExperimentID( + "Instant", "INSTANT", chrome_variations::kInstantIDInstant); } // static diff --git a/chrome/common/metrics/variation_ids.h b/chrome/common/metrics/variation_ids.h index 0be64d6..18a8134 100644 --- a/chrome/common/metrics/variation_ids.h +++ b/chrome/common/metrics/variation_ids.h @@ -65,6 +65,17 @@ enum ID { // Add new variation IDs below. + // Suggest (Autocomplete) field trial, 20 IDs. + kSuggestIDMin = 3310000, + kSuggestIDMax = 3310019, + + // Instant field trial. + kInstantIDControl = 3310020, + kInstantIDSilent = 3310021, + kInstantIDHidden = 3310022, + kInstantIDSuggest = 3310023, + kInstantIDInstant = 3310024, + // USABLE IDs END HERE. // // The largest possible Chrome variation ID in the reserved range. When |