| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "chrome/browser/jankometer.h" | 48 #include "chrome/browser/jankometer.h" |
| 49 #include "chrome/browser/language_usage_metrics.h" | 49 #include "chrome/browser/language_usage_metrics.h" |
| 50 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 50 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
| 51 #include "chrome/browser/metrics/histogram_synchronizer.h" | 51 #include "chrome/browser/metrics/histogram_synchronizer.h" |
| 52 #include "chrome/browser/metrics/metrics_log.h" | 52 #include "chrome/browser/metrics/metrics_log.h" |
| 53 #include "chrome/browser/metrics/metrics_service.h" | 53 #include "chrome/browser/metrics/metrics_service.h" |
| 54 #include "chrome/browser/metrics/thread_watcher.h" | 54 #include "chrome/browser/metrics/thread_watcher.h" |
| 55 #include "chrome/browser/metrics/tracking_synchronizer.h" | 55 #include "chrome/browser/metrics/tracking_synchronizer.h" |
| 56 #include "chrome/browser/nacl_host/nacl_process_host.h" | 56 #include "chrome/browser/nacl_host/nacl_process_host.h" |
| 57 #include "chrome/browser/net/chrome_net_log.h" | 57 #include "chrome/browser/net/chrome_net_log.h" |
| 58 #include "chrome/browser/net/chrome_network_delegate.h" |
| 58 #include "chrome/browser/net/predictor.h" | 59 #include "chrome/browser/net/predictor.h" |
| 59 #include "chrome/browser/notifications/desktop_notification_service.h" | 60 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 60 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 61 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 61 #include "chrome/browser/plugin_prefs.h" | 62 #include "chrome/browser/plugin_prefs.h" |
| 62 #include "chrome/browser/prefs/pref_service.h" | 63 #include "chrome/browser/prefs/pref_service.h" |
| 63 #include "chrome/browser/prefs/pref_value_store.h" | 64 #include "chrome/browser/prefs/pref_value_store.h" |
| 64 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 65 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 65 #include "chrome/browser/prerender/prerender_field_trial.h" | 66 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 66 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 67 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 67 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 68 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 // Create a 100% field trial based on the brand code. | 1001 // Create a 100% field trial based on the brand code. |
| 1001 if (auto_launch_trial::IsInExperimentGroup(brand)) { | 1002 if (auto_launch_trial::IsInExperimentGroup(brand)) { |
| 1002 base::FieldTrialList::CreateFieldTrial(kAutoLaunchTrialName, | 1003 base::FieldTrialList::CreateFieldTrial(kAutoLaunchTrialName, |
| 1003 kAutoLaunchTrialAutoLaunchGroup); | 1004 kAutoLaunchTrialAutoLaunchGroup); |
| 1004 } else if (auto_launch_trial::IsInControlGroup(brand)) { | 1005 } else if (auto_launch_trial::IsInControlGroup(brand)) { |
| 1005 base::FieldTrialList::CreateFieldTrial(kAutoLaunchTrialName, | 1006 base::FieldTrialList::CreateFieldTrial(kAutoLaunchTrialName, |
| 1006 kAutoLaunchTrialControlGroup); | 1007 kAutoLaunchTrialControlGroup); |
| 1007 } | 1008 } |
| 1008 } | 1009 } |
| 1009 | 1010 |
| 1011 void ChromeBrowserMainParts::ComodoDNSExperimentFieldTrial() { |
| 1012 // 100% probability of being in the experiment group until the timeout. |
| 1013 const base::FieldTrial::Probability kDivisor = 1; |
| 1014 const base::FieldTrial::Probability kProbability = 1; |
| 1015 |
| 1016 // After April 15, 2012 builds, it will always be in default group. |
| 1017 scoped_refptr<base::FieldTrial> trial( |
| 1018 new base::FieldTrial("ComodoDNSExperiment", kDivisor, |
| 1019 "inactive", 2012, 4, 15)); |
| 1020 |
| 1021 const int active = trial->AppendGroup("active", kProbability); |
| 1022 |
| 1023 if (trial->group() == active) |
| 1024 ChromeNetworkDelegate::EnableComodoDNSExperiment(); |
| 1025 } |
| 1026 |
| 1010 // ChromeBrowserMainParts: |SetupMetricsAndFieldTrials()| related -------------- | 1027 // ChromeBrowserMainParts: |SetupMetricsAndFieldTrials()| related -------------- |
| 1011 | 1028 |
| 1012 void ChromeBrowserMainParts::SetupFieldTrials(bool metrics_recording_enabled, | 1029 void ChromeBrowserMainParts::SetupFieldTrials(bool metrics_recording_enabled, |
| 1013 bool proxy_policy_is_set) { | 1030 bool proxy_policy_is_set) { |
| 1014 // Note: make sure to call ConnectionFieldTrial() before | 1031 // Note: make sure to call ConnectionFieldTrial() before |
| 1015 // ProxyConnectionsFieldTrial(). | 1032 // ProxyConnectionsFieldTrial(). |
| 1016 ConnectionFieldTrial(); | 1033 ConnectionFieldTrial(); |
| 1017 SocketTimeoutFieldTrial(); | 1034 SocketTimeoutFieldTrial(); |
| 1018 // If a policy is defining the number of active connections this field test | 1035 // If a policy is defining the number of active connections this field test |
| 1019 // shoud not be performed. | 1036 // shoud not be performed. |
| 1020 if (!proxy_policy_is_set) | 1037 if (!proxy_policy_is_set) |
| 1021 ProxyConnectionsFieldTrial(); | 1038 ProxyConnectionsFieldTrial(); |
| 1022 prerender::ConfigurePrefetchAndPrerender(parsed_command_line()); | 1039 prerender::ConfigurePrefetchAndPrerender(parsed_command_line()); |
| 1023 InstantFieldTrial::Activate(); | 1040 InstantFieldTrial::Activate(); |
| 1024 SpdyFieldTrial(); | 1041 SpdyFieldTrial(); |
| 1025 ConnectBackupJobsFieldTrial(); | 1042 ConnectBackupJobsFieldTrial(); |
| 1026 WarmConnectionFieldTrial(); | 1043 WarmConnectionFieldTrial(); |
| 1027 PredictorFieldTrial(); | 1044 PredictorFieldTrial(); |
| 1028 DefaultAppsFieldTrial(); | 1045 DefaultAppsFieldTrial(); |
| 1029 AutoLaunchChromeFieldTrial(); | 1046 AutoLaunchChromeFieldTrial(); |
| 1047 ComodoDNSExperimentFieldTrial(); |
| 1030 AutocompleteFieldTrial::Activate(); | 1048 AutocompleteFieldTrial::Activate(); |
| 1031 sync_promo_trial::Activate(); | 1049 sync_promo_trial::Activate(); |
| 1032 NewTabUI::SetupFieldTrials(); | 1050 NewTabUI::SetupFieldTrials(); |
| 1033 } | 1051 } |
| 1034 | 1052 |
| 1035 void ChromeBrowserMainParts::StartMetricsRecording() { | 1053 void ChromeBrowserMainParts::StartMetricsRecording() { |
| 1036 MetricsService* metrics = g_browser_process->metrics_service(); | 1054 MetricsService* metrics = g_browser_process->metrics_service(); |
| 1037 if (parsed_command_line_.HasSwitch(switches::kMetricsRecordingOnly) || | 1055 if (parsed_command_line_.HasSwitch(switches::kMetricsRecordingOnly) || |
| 1038 parsed_command_line_.HasSwitch(switches::kEnableBenchmarking)) { | 1056 parsed_command_line_.HasSwitch(switches::kEnableBenchmarking)) { |
| 1039 // If we're testing then we don't care what the user preference is, we turn | 1057 // If we're testing then we don't care what the user preference is, we turn |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1949 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1967 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1950 uma_name += "_XP"; | 1968 uma_name += "_XP"; |
| 1951 | 1969 |
| 1952 uma_name += "_PreRead_"; | 1970 uma_name += "_PreRead_"; |
| 1953 uma_name += pre_read_percentage; | 1971 uma_name += pre_read_percentage; |
| 1954 AddPreReadHistogramTime(uma_name.c_str(), time); | 1972 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1955 } | 1973 } |
| 1956 #endif | 1974 #endif |
| 1957 #endif | 1975 #endif |
| 1958 } | 1976 } |
| OLD | NEW |