| 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 "apps/field_trial_names.h" | 9 #include "apps/field_trial_names.h" |
| 10 #include "apps/pref_names.h" | 10 #include "apps/pref_names.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "chrome/browser/auto_launch_trial.h" | 15 #include "chrome/browser/auto_launch_trial.h" |
| 16 #include "chrome/browser/google/google_util.h" | 16 #include "chrome/browser/google/google_util.h" |
| 17 #include "chrome/browser/gpu/chrome_gpu_util.h" | 17 #include "chrome/browser/gpu/chrome_gpu_util.h" |
| 18 #include "chrome/browser/omnibox/omnibox_field_trial.h" | 18 #include "chrome/browser/omnibox/omnibox_field_trial.h" |
| 19 #include "chrome/browser/prerender/prerender_field_trial.h" | 19 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager_util.h" |
| 21 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 21 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 22 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 22 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/chrome_version_info.h" | 24 #include "chrome/common/chrome_version_info.h" |
| 25 #include "chrome/common/metrics/variations/variations_util.h" | 25 #include "chrome/common/metrics/variations/variations_util.h" |
| 26 #include "net/spdy/spdy_session.h" | 26 #include "net/spdy/spdy_session.h" |
| 27 #include "ui/base/layout.h" | 27 #include "ui/base/layout.h" |
| 28 | 28 |
| 29 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
| 30 #include "net/socket/tcp_client_socket_win.h" | 30 #include "net/socket/tcp_client_socket_win.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 void DisableShowProfileSwitcherTrialIfNecessary() { | 71 void DisableShowProfileSwitcherTrialIfNecessary() { |
| 72 // This trial is created by the VariationsService, but it needs to be disabled | 72 // This trial is created by the VariationsService, but it needs to be disabled |
| 73 // if multi-profiles isn't enabled or if browser frame avatar menu is | 73 // if multi-profiles isn't enabled or if browser frame avatar menu is |
| 74 // always hidden (Chrome OS). | 74 // always hidden (Chrome OS). |
| 75 bool avatar_menu_always_hidden = false; | 75 bool avatar_menu_always_hidden = false; |
| 76 #if defined(OS_CHROMEOS) | 76 #if defined(OS_CHROMEOS) |
| 77 avatar_menu_always_hidden = true; | 77 avatar_menu_always_hidden = true; |
| 78 #endif | 78 #endif |
| 79 base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher"); | 79 base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher"); |
| 80 if (trial && (!ProfileManager::IsMultipleProfilesEnabled() || | 80 if (trial && (!profiles::IsMultipleProfilesEnabled() || |
| 81 avatar_menu_always_hidden)) { | 81 avatar_menu_always_hidden)) { |
| 82 trial->Disable(); | 82 trial->Disable(); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 void SetUpCacheSensitivityAnalysisFieldTrial() { | 86 void SetUpCacheSensitivityAnalysisFieldTrial() { |
| 87 const base::FieldTrial::Probability kDivisor = 100; | 87 const base::FieldTrial::Probability kDivisor = 100; |
| 88 | 88 |
| 89 base::FieldTrial::Probability sensitivity_analysis_probability = 0; | 89 base::FieldTrial::Probability sensitivity_analysis_probability = 0; |
| 90 | 90 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 gpu_util::InitializeCompositingFieldTrial(); | 151 gpu_util::InitializeCompositingFieldTrial(); |
| 152 OmniboxFieldTrial::ActivateStaticTrials(); | 152 OmniboxFieldTrial::ActivateStaticTrials(); |
| 153 SetUpInfiniteCacheFieldTrial(); | 153 SetUpInfiniteCacheFieldTrial(); |
| 154 SetUpCacheSensitivityAnalysisFieldTrial(); | 154 SetUpCacheSensitivityAnalysisFieldTrial(); |
| 155 DisableShowProfileSwitcherTrialIfNecessary(); | 155 DisableShowProfileSwitcherTrialIfNecessary(); |
| 156 WindowsOverlappedTCPReadsFieldTrial(parsed_command_line); | 156 WindowsOverlappedTCPReadsFieldTrial(parsed_command_line); |
| 157 SetupAppLauncherFieldTrial(local_state); | 157 SetupAppLauncherFieldTrial(local_state); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace chrome | 160 } // namespace chrome |
| OLD | NEW |