Roll src/third_party/WebKit eb1578b:b559582 (svn 193425:193437)
[chromium-blink-merge.git] / chrome / browser / chrome_browser_field_trials.cc
blob2a6a43296eba7f632af83ab79f9d9f3233be9de8
1 // 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.
5 #include "chrome/browser/chrome_browser_field_trials.h"
7 #include <string>
9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h"
11 #include "base/strings/string_util.h"
12 #include "base/time/time.h"
13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/common/chrome_version_info.h"
15 #include "components/metrics/metrics_pref_names.h"
16 #include "components/omnibox/omnibox_field_trial.h"
18 #if defined(OS_ANDROID) || defined(OS_IOS)
19 #include "chrome/browser/chrome_browser_field_trials_mobile.h"
20 #else
21 #include "chrome/browser/chrome_browser_field_trials_desktop.h"
22 #endif
24 ChromeBrowserFieldTrials::ChromeBrowserFieldTrials(
25 const base::CommandLine& parsed_command_line)
26 : parsed_command_line_(parsed_command_line) {
29 ChromeBrowserFieldTrials::~ChromeBrowserFieldTrials() {
32 void ChromeBrowserFieldTrials::SetupFieldTrials() {
33 // Field trials that are shared by all platforms.
34 InstantiateDynamicTrials();
36 #if defined(OS_ANDROID) || defined(OS_IOS)
37 chrome::SetupMobileFieldTrials(parsed_command_line_);
38 #else
39 chrome::SetupDesktopFieldTrials(parsed_command_line_);
40 #endif
43 void ChromeBrowserFieldTrials::InstantiateDynamicTrials() {
44 // The following trials are used from renderer process.
45 // Mark here so they will be sync-ed.
46 base::FieldTrialList::FindValue("CLD1VsCLD2");
47 base::FieldTrialList::FindValue("DisplayList2dCanvas");
48 // Activate the autocomplete dynamic field trials.
49 OmniboxFieldTrial::ActivateDynamicTrials();