Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/auto_launch_trial.h" | 5 #include "chrome/browser/auto_launch_trial.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/string_util.h" | |
| 10 #include "chrome/browser/first_run/first_run.h" | 11 #include "chrome/browser/first_run/first_run.h" |
| 11 #include "chrome/installer/util/master_preferences_constants.h" | 12 #include "chrome/installer/util/master_preferences_constants.h" |
| 12 #include "chrome/installer/util/master_preferences.h" | 13 #include "chrome/installer/util/master_preferences.h" |
| 13 | 14 |
| 14 const char kAutoLaunchTrialName[] = "AutoLaunchExperiment"; | 15 const char kAutoLaunchTrialName[] = "AutoLaunchExperiment"; |
| 15 const char kAutoLaunchTrialAutoLaunchGroup[] = "AutoLaunching"; | 16 const char kAutoLaunchTrialAutoLaunchGroup[] = "AutoLaunching"; |
| 16 const char kAutoLaunchTrialControlGroup[] = "NotAutoLaunching"; | 17 const char kAutoLaunchTrialControlGroup[] = "NotAutoLaunching"; |
| 17 | 18 |
| 18 namespace auto_launch_trial { | 19 namespace auto_launch_trial { |
| 19 | 20 |
| 20 bool IsInAutoLaunchGroup() { | 21 bool IsInAutoLaunchFieldTrial() { |
|
Roger Tawa OOO till Jul 10th
2011/12/16 20:44:31
I actually think the old name was better. Remembe
| |
| 21 return base::FieldTrialList::TrialExists(kAutoLaunchTrialName) && | 22 return base::FieldTrialList::TrialExists(kAutoLaunchTrialName) && |
| 22 base::FieldTrialList::Find(kAutoLaunchTrialName)->group_name() | 23 base::FieldTrialList::Find(kAutoLaunchTrialName)->group_name() |
| 23 == kAutoLaunchTrialAutoLaunchGroup; | 24 == kAutoLaunchTrialAutoLaunchGroup; |
| 24 } | 25 } |
| 25 | 26 |
| 27 bool IsInExperimentGroup(const std::string& brand_code) { | |
| 28 return LowerCaseEqualsASCII(brand_code, "rngp"); | |
| 29 } | |
| 30 | |
| 31 bool IsInControlGroup(const std::string& brand_code) { | |
| 32 return LowerCaseEqualsASCII(brand_code, "rngq"); | |
| 33 } | |
| 34 | |
| 26 void UpdateToggleAutoLaunchMetric(bool auto_launch) { | 35 void UpdateToggleAutoLaunchMetric(bool auto_launch) { |
| 27 UMA_HISTOGRAM_ENUMERATION( | 36 UMA_HISTOGRAM_ENUMERATION( |
| 28 base::FieldTrial::MakeName("ToggleAutoLaunch", kAutoLaunchTrialName), | 37 base::FieldTrial::MakeName("ToggleAutoLaunch", kAutoLaunchTrialName), |
| 29 auto_launch ? 1 : 0, 2); | 38 auto_launch ? 1 : 0, 2); |
| 30 } | 39 } |
| 31 | 40 |
| 32 void UpdateInfobarResponseMetric(InfobarMetricResponse response) { | 41 void UpdateInfobarResponseMetric(InfobarMetricResponse response) { |
| 33 UMA_HISTOGRAM_ENUMERATION( | 42 UMA_HISTOGRAM_ENUMERATION( |
| 34 base::FieldTrial::MakeName("InfobarRepsonse", kAutoLaunchTrialName), | 43 base::FieldTrial::MakeName("InfobarRepsonse", kAutoLaunchTrialName), |
| 35 response, 3); | 44 response, 3); |
| 36 } | 45 } |
| 37 | 46 |
| 38 void UpdateInfobarShownMetric() { | 47 void UpdateInfobarShownMetric() { |
| 39 UMA_HISTOGRAM_COUNTS( | 48 UMA_HISTOGRAM_COUNTS( |
| 40 base::FieldTrial::MakeName("InfobarShown", kAutoLaunchTrialName), 1); | 49 base::FieldTrial::MakeName("InfobarShown", kAutoLaunchTrialName), 1); |
| 41 } | 50 } |
| 42 | 51 |
| 43 } // namespace auto_launch_trial | 52 } // namespace auto_launch_trial |
| OLD | NEW |