[email protected] | ae9e12a | 2012-07-31 17:48:12 | [diff] [blame] | 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. | ||||
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] | e746341 | 2013-06-10 22:53:46 | [diff] [blame] | 11 | #include "base/strings/string_util.h" |
[email protected] | 4dcb797 | 2013-06-28 15:15:41 | [diff] [blame] | 12 | #include "base/time/time.h" |
[email protected] | ae9e12a | 2012-07-31 17:48:12 | [diff] [blame] | 13 | #include "chrome/common/chrome_switches.h" |
[email protected] | 6580145 | 2014-07-09 05:42:41 | [diff] [blame] | 14 | #include "components/metrics/metrics_pref_names.h" |
blundell | 2102f7c | 2015-07-09 10:00:53 | [diff] [blame] | 15 | #include "components/omnibox/browser/omnibox_field_trial.h" |
[email protected] | ae9e12a | 2012-07-31 17:48:12 | [diff] [blame] | 16 | |
[email protected] | aa61db0 | 2013-04-23 00:23:49 | [diff] [blame] | 17 | #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] | ae9e12a | 2012-07-31 17:48:12 | [diff] [blame] | 22 | |
[email protected] | ae9e12a | 2012-07-31 17:48:12 | [diff] [blame] | 23 | ChromeBrowserFieldTrials::ChromeBrowserFieldTrials( |
avi | 3ef9ec9e | 2014-12-22 22:50:17 | [diff] [blame] | 24 | const base::CommandLine& parsed_command_line) |
[email protected] | e86df8dc | 2013-03-30 13:18:28 | [diff] [blame] | 25 | : parsed_command_line_(parsed_command_line) { |
[email protected] | ae9e12a | 2012-07-31 17:48:12 | [diff] [blame] | 26 | } |
27 | |||||
28 | ChromeBrowserFieldTrials::~ChromeBrowserFieldTrials() { | ||||
29 | } | ||||
30 | |||||
isherman | 292673a | 2015-03-31 22:04:29 | [diff] [blame] | 31 | void ChromeBrowserFieldTrials::SetupFieldTrials() { |
[email protected] | aa61db0 | 2013-04-23 00:23:49 | [diff] [blame] | 32 | // Field trials that are shared by all platforms. |
[email protected] | ebc60b7 | 2013-04-21 06:15:40 | [diff] [blame] | 33 | InstantiateDynamicTrials(); |
[email protected] | 63ad35d5 | 2013-04-02 00:17:21 | [diff] [blame] | 34 | |
35 | #if defined(OS_ANDROID) || defined(OS_IOS) | ||||
[email protected] | 64b8652c | 2014-07-16 19:14:28 | [diff] [blame] | 36 | chrome::SetupMobileFieldTrials(parsed_command_line_); |
[email protected] | aa61db0 | 2013-04-23 00:23:49 | [diff] [blame] | 37 | #else |
benwells | 0ab9cc3 | 2015-03-12 09:41:05 | [diff] [blame] | 38 | chrome::SetupDesktopFieldTrials(parsed_command_line_); |
[email protected] | e3e94f7 | 2012-09-14 02:11:42 | [diff] [blame] | 39 | #endif |
[email protected] | a0cdf26 | 2013-02-01 01:12:12 | [diff] [blame] | 40 | } |
41 | |||||
[email protected] | bd557d4 | 2012-11-01 15:49:09 | [diff] [blame] | 42 | void ChromeBrowserFieldTrials::InstantiateDynamicTrials() { |
[email protected] | 6785d807 | 2013-10-11 23:42:09 | [diff] [blame] | 43 | // The following trials are used from renderer process. |
44 | // Mark here so they will be sync-ed. | ||||
piotaixr | bc9cd5f | 2014-08-26 22:24:14 | [diff] [blame] | 45 | base::FieldTrialList::FindValue("DisplayList2dCanvas"); |
[email protected] | dc1f854 | 2013-01-30 05:10:29 | [diff] [blame] | 46 | // Activate the autocomplete dynamic field trials. |
[email protected] | 684fcc1 | 2013-03-08 22:50:02 | [diff] [blame] | 47 | OmniboxFieldTrial::ActivateDynamicTrials(); |
[email protected] | bd557d4 | 2012-11-01 15:49:09 | [diff] [blame] | 48 | } |