blob: 9ce113f9675862b6cb790df76d78bb9d4ac5e5a8 [file] [log] [blame]
[email protected]ae9e12a2012-07-31 17:48:121// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/chrome_browser_field_trials.h"
6
7#include <string>
8
9#include "base/command_line.h"
10#include "base/metrics/field_trial.h"
[email protected]e7463412013-06-10 22:53:4611#include "base/strings/string_util.h"
[email protected]4dcb7972013-06-28 15:15:4112#include "base/time/time.h"
[email protected]ae9e12a2012-07-31 17:48:1213#include "chrome/common/chrome_switches.h"
[email protected]65801452014-07-09 05:42:4114#include "components/metrics/metrics_pref_names.h"
blundell2102f7c2015-07-09 10:00:5315#include "components/omnibox/browser/omnibox_field_trial.h"
[email protected]ae9e12a2012-07-31 17:48:1216
[email protected]aa61db02013-04-23 00:23:4917#if defined(OS_ANDROID) || defined(OS_IOS)
18#include "chrome/browser/chrome_browser_field_trials_mobile.h"
19#else
20#include "chrome/browser/chrome_browser_field_trials_desktop.h"
21#endif
[email protected]ae9e12a2012-07-31 17:48:1222
[email protected]ae9e12a2012-07-31 17:48:1223ChromeBrowserFieldTrials::ChromeBrowserFieldTrials(
avi3ef9ec9e2014-12-22 22:50:1724 const base::CommandLine& parsed_command_line)
[email protected]e86df8dc2013-03-30 13:18:2825 : parsed_command_line_(parsed_command_line) {
[email protected]ae9e12a2012-07-31 17:48:1226}
27
28ChromeBrowserFieldTrials::~ChromeBrowserFieldTrials() {
29}
30
isherman292673a2015-03-31 22:04:2931void ChromeBrowserFieldTrials::SetupFieldTrials() {
[email protected]aa61db02013-04-23 00:23:4932 // Field trials that are shared by all platforms.
[email protected]ebc60b72013-04-21 06:15:4033 InstantiateDynamicTrials();
[email protected]63ad35d52013-04-02 00:17:2134
35#if defined(OS_ANDROID) || defined(OS_IOS)
[email protected]64b8652c2014-07-16 19:14:2836 chrome::SetupMobileFieldTrials(parsed_command_line_);
[email protected]aa61db02013-04-23 00:23:4937#else
benwells0ab9cc32015-03-12 09:41:0538 chrome::SetupDesktopFieldTrials(parsed_command_line_);
[email protected]e3e94f72012-09-14 02:11:4239#endif
[email protected]a0cdf262013-02-01 01:12:1240}
41
[email protected]bd557d42012-11-01 15:49:0942void ChromeBrowserFieldTrials::InstantiateDynamicTrials() {
[email protected]6785d8072013-10-11 23:42:0943 // The following trials are used from renderer process.
44 // Mark here so they will be sync-ed.
piotaixrbc9cd5f2014-08-26 22:24:1445 base::FieldTrialList::FindValue("DisplayList2dCanvas");
[email protected]dc1f8542013-01-30 05:10:2946 // Activate the autocomplete dynamic field trials.
[email protected]684fcc12013-03-08 22:50:0247 OmniboxFieldTrial::ActivateDynamicTrials();
[email protected]bd557d42012-11-01 15:49:0948}