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 "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "chrome/browser/auto_launch_trial.h" | 13 #include "chrome/browser/auto_launch_trial.h" |
14 #include "chrome/browser/google/google_brand.h" | 14 #include "chrome/browser/google/google_brand.h" |
15 #include "chrome/browser/prerender/prerender_field_trial.h" | 15 #include "chrome/browser/prerender/prerender_field_trial.h" |
16 #include "chrome/browser/profiles/profiles_state.h" | 16 #include "chrome/browser/profiles/profiles_state.h" |
17 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 17 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
18 #include "chrome/browser/ui/app_list/app_list_util.h" | 18 #include "chrome/browser/ui/app_list/app_list_util.h" |
19 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 19 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/common/chrome_version_info.h" | 21 #include "chrome/common/chrome_version_info.h" |
22 #include "chrome/common/variations/variations_util.h" | 22 #include "chrome/common/variations/variations_util.h" |
23 #include "components/variations/variations_associated_data.h" | |
23 #include "content/public/common/content_constants.h" | 24 #include "content/public/common/content_constants.h" |
24 #include "net/spdy/spdy_session.h" | 25 #include "net/spdy/spdy_session.h" |
25 #include "ui/base/layout.h" | 26 #include "ui/base/layout.h" |
26 | 27 |
27 namespace chrome { | 28 namespace chrome { |
28 | 29 |
29 namespace { | 30 namespace { |
30 | 31 |
31 void AutoLaunchChromeFieldTrial() { | 32 void AutoLaunchChromeFieldTrial() { |
32 std::string brand; | 33 std::string brand; |
(...skipping 23 matching lines...) Expand all Loading... | |
56 } | 57 } |
57 | 58 |
58 void DisableShowProfileSwitcherTrialIfNecessary() { | 59 void DisableShowProfileSwitcherTrialIfNecessary() { |
59 // This trial is created by the VariationsService, but it needs to be disabled | 60 // This trial is created by the VariationsService, but it needs to be disabled |
60 // if multi-profiles isn't enabled. | 61 // if multi-profiles isn't enabled. |
61 base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher"); | 62 base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher"); |
62 if (trial && !profiles::IsMultipleProfilesEnabled()) | 63 if (trial && !profiles::IsMultipleProfilesEnabled()) |
63 trial->Disable(); | 64 trial->Disable(); |
64 } | 65 } |
65 | 66 |
67 void SetupLightSpeedTrials() { | |
68 std::map<std::string, std::string> params; | |
69 if (!variations::GetVariationParams("LightSpeed", ¶ms)) | |
gab
2015/03/10 19:42:12
Why not use typical GetVariationParamValue("LightS
Alexei Svitkine (slow)
2015/03/10 19:48:36
This was setting up up multiple parameters in a pr
Alexei Svitkine (slow)
2015/03/11 15:57:08
Done.
| |
70 return; | |
71 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
gab
2015/03/10 19:42:12
Inline this below.
Alexei Svitkine (slow)
2015/03/11 15:57:08
Done.
| |
72 if (ContainsKey(params, "NoGpu")) | |
73 command_line->AppendSwitch(switches::kDisableGpu); | |
74 } | |
75 | |
66 } // namespace | 76 } // namespace |
67 | 77 |
68 void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line, | 78 void SetupDesktopFieldTrials(const base::CommandLine& parsed_command_line, |
69 PrefService* local_state) { | 79 PrefService* local_state) { |
70 prerender::ConfigurePrerender(parsed_command_line); | 80 prerender::ConfigurePrerender(parsed_command_line); |
71 AutoLaunchChromeFieldTrial(); | 81 AutoLaunchChromeFieldTrial(); |
72 SetupInfiniteCacheFieldTrial(); | 82 SetupInfiniteCacheFieldTrial(); |
73 DisableShowProfileSwitcherTrialIfNecessary(); | 83 DisableShowProfileSwitcherTrialIfNecessary(); |
84 SetupLightSpeedTrials(); | |
74 SetupShowAppLauncherPromoFieldTrial(local_state); | 85 SetupShowAppLauncherPromoFieldTrial(local_state); |
75 } | 86 } |
76 | 87 |
77 } // namespace chrome | 88 } // namespace chrome |
OLD | NEW |