| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_browser_field_trials_desktop.h" | 5 #include "chrome/browser/chrome_browser_field_trials_desktop.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 #include "chrome/browser/auto_launch_trial.h" | |
| 12 #include "chrome/browser/google/google_brand.h" | |
| 13 #include "chrome/browser/prerender/prerender_field_trial.h" | 11 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 14 #include "chrome/browser/tracing/background_tracing_field_trial.h" | 12 #include "chrome/browser/tracing/background_tracing_field_trial.h" |
| 15 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/variations/variations_util.h" | 14 #include "chrome/common/variations/variations_util.h" |
| 17 #include "components/variations/variations_associated_data.h" | 15 #include "components/variations/variations_associated_data.h" |
| 18 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
| 19 | 17 |
| 20 namespace chrome { | 18 namespace chrome { |
| 21 | 19 |
| 22 namespace { | 20 namespace { |
| 23 | 21 |
| 24 void AutoLaunchChromeFieldTrial() { | |
| 25 std::string brand; | |
| 26 google_brand::GetBrand(&brand); | |
| 27 | |
| 28 // Create a 100% field trial based on the brand code. | |
| 29 if (auto_launch_trial::IsInExperimentGroup(brand)) { | |
| 30 base::FieldTrialList::CreateFieldTrial(kAutoLaunchTrialName, | |
| 31 kAutoLaunchTrialAutoLaunchGroup); | |
| 32 } else if (auto_launch_trial::IsInControlGroup(brand)) { | |
| 33 base::FieldTrialList::CreateFieldTrial(kAutoLaunchTrialName, | |
| 34 kAutoLaunchTrialControlGroup); | |
| 35 } | |
| 36 } | |
| 37 | |
| 38 void SetupLightSpeedTrials() { | 22 void SetupLightSpeedTrials() { |
| 39 if (!variations::GetVariationParamValue("LightSpeed", "NoGpu").empty()) { | 23 if (!variations::GetVariationParamValue("LightSpeed", "NoGpu").empty()) { |
| 40 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 24 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 41 switches::kDisableGpu); | 25 switches::kDisableGpu); |
| 42 } | 26 } |
| 43 } | 27 } |
| 44 | 28 |
| 45 void SetupStunProbeTrial() { | 29 void SetupStunProbeTrial() { |
| 46 #if defined(ENABLE_WEBRTC) | 30 #if defined(ENABLE_WEBRTC) |
| 47 std::map<std::string, std::string> params; | 31 std::map<std::string, std::string> params; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 60 | 44 |
| 61 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 45 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 62 switches::kWebRtcStunProbeTrialParameter, cmd_param); | 46 switches::kWebRtcStunProbeTrialParameter, cmd_param); |
| 63 #endif | 47 #endif |
| 64 } | 48 } |
| 65 | 49 |
| 66 } // namespace | 50 } // namespace |
| 67 | 51 |
| 68 void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line) { | 52 void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line) { |
| 69 prerender::ConfigurePrerender(parsed_command_line); | 53 prerender::ConfigurePrerender(parsed_command_line); |
| 70 AutoLaunchChromeFieldTrial(); | |
| 71 SetupLightSpeedTrials(); | 54 SetupLightSpeedTrials(); |
| 72 tracing::SetupBackgroundTracingFieldTrial(); | 55 tracing::SetupBackgroundTracingFieldTrial(); |
| 73 SetupStunProbeTrial(); | 56 SetupStunProbeTrial(); |
| 74 } | 57 } |
| 75 | 58 |
| 76 } // namespace chrome | 59 } // namespace chrome |
| OLD | NEW |