| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/browser/gpu_util.h" | 49 #include "chrome/browser/gpu_util.h" |
| 50 #include "chrome/browser/instant/instant_field_trial.h" | 50 #include "chrome/browser/instant/instant_field_trial.h" |
| 51 #include "chrome/browser/jankometer.h" | 51 #include "chrome/browser/jankometer.h" |
| 52 #include "chrome/browser/language_usage_metrics.h" | 52 #include "chrome/browser/language_usage_metrics.h" |
| 53 #include "chrome/browser/metrics/histogram_synchronizer.h" | 53 #include "chrome/browser/metrics/histogram_synchronizer.h" |
| 54 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 54 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
| 55 #include "chrome/browser/metrics/metrics_log.h" | 55 #include "chrome/browser/metrics/metrics_log.h" |
| 56 #include "chrome/browser/metrics/metrics_service.h" | 56 #include "chrome/browser/metrics/metrics_service.h" |
| 57 #include "chrome/browser/metrics/thread_watcher.h" | 57 #include "chrome/browser/metrics/thread_watcher.h" |
| 58 #include "chrome/browser/metrics/tracking_synchronizer.h" | 58 #include "chrome/browser/metrics/tracking_synchronizer.h" |
| 59 #include "chrome/browser/metrics/variations_service.h" |
| 59 #include "chrome/browser/nacl_host/nacl_process_host.h" | 60 #include "chrome/browser/nacl_host/nacl_process_host.h" |
| 60 #include "chrome/browser/net/chrome_net_log.h" | 61 #include "chrome/browser/net/chrome_net_log.h" |
| 61 #include "chrome/browser/net/predictor.h" | 62 #include "chrome/browser/net/predictor.h" |
| 62 #include "chrome/browser/notifications/desktop_notification_service.h" | 63 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 63 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 64 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 64 #include "chrome/browser/plugin_prefs.h" | 65 #include "chrome/browser/plugin_prefs.h" |
| 65 #include "chrome/browser/prefs/pref_service.h" | 66 #include "chrome/browser/prefs/pref_service.h" |
| 66 #include "chrome/browser/prefs/pref_value_store.h" | 67 #include "chrome/browser/prefs/pref_value_store.h" |
| 67 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 68 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 68 #include "chrome/browser/prerender/prerender_field_trial.h" | 69 #include "chrome/browser/prerender/prerender_field_trial.h" |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 606 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 606 if (command_line->HasSwitch(switches::kForceFieldTrials)) { | 607 if (command_line->HasSwitch(switches::kForceFieldTrials)) { |
| 607 std::string persistent = command_line->GetSwitchValueASCII( | 608 std::string persistent = command_line->GetSwitchValueASCII( |
| 608 switches::kForceFieldTrials); | 609 switches::kForceFieldTrials); |
| 609 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); | 610 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); |
| 610 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << | 611 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << |
| 611 " list specified."; | 612 " list specified."; |
| 612 } | 613 } |
| 613 #endif // NDEBUG | 614 #endif // NDEBUG |
| 614 | 615 |
| 616 VariationsService* variations_service = VariationsService::GetInstance(); |
| 617 variations_service->LoadVariationsSeed(browser_process_->local_state()); |
| 618 |
| 615 SetupFieldTrials(metrics->recording_active(), | 619 SetupFieldTrials(metrics->recording_active(), |
| 616 local_state_->IsManagedPreference( | 620 local_state_->IsManagedPreference( |
| 617 prefs::kMaxConnectionsPerProxy)); | 621 prefs::kMaxConnectionsPerProxy)); |
| 618 | 622 |
| 619 // Initialize FieldTrialSynchronizer system. This is a singleton and is used | 623 // Initialize FieldTrialSynchronizer system. This is a singleton and is used |
| 620 // for posting tasks via base::Bind. Its deleted when it goes out of scope. | 624 // for posting tasks via base::Bind. Its deleted when it goes out of scope. |
| 621 // Even though base::Bind does AddRef and Release, the object will not be | 625 // Even though base::Bind does AddRef and Release, the object will not be |
| 622 // deleted after the Task is executed. | 626 // deleted after the Task is executed. |
| 623 field_trial_synchronizer_ = new FieldTrialSynchronizer(); | 627 field_trial_synchronizer_ = new FieldTrialSynchronizer(); |
| 624 } | 628 } |
| (...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 | 1869 |
| 1866 // TODO(mad): Move this call in a proper place on CrOS. | 1870 // TODO(mad): Move this call in a proper place on CrOS. |
| 1867 // http://crosbug.com/17687 | 1871 // http://crosbug.com/17687 |
| 1868 #if !defined(OS_CHROMEOS) | 1872 #if !defined(OS_CHROMEOS) |
| 1869 // If we're running tests (ui_task is non-null), then we don't want to | 1873 // If we're running tests (ui_task is non-null), then we don't want to |
| 1870 // call FetchLanguageListFromTranslateServer | 1874 // call FetchLanguageListFromTranslateServer |
| 1871 if (parameters().ui_task == NULL && translate_manager_ != NULL) { | 1875 if (parameters().ui_task == NULL && translate_manager_ != NULL) { |
| 1872 translate_manager_->FetchLanguageListFromTranslateServer( | 1876 translate_manager_->FetchLanguageListFromTranslateServer( |
| 1873 profile_->GetPrefs()); | 1877 profile_->GetPrefs()); |
| 1874 } | 1878 } |
| 1879 |
| 1880 // Request new variations seed information from server. |
| 1881 VariationsService::GetInstance()->StartFetchingVariationsSeed(); |
| 1875 #endif | 1882 #endif |
| 1876 | 1883 |
| 1877 run_message_loop_ = true; | 1884 run_message_loop_ = true; |
| 1878 } else { | 1885 } else { |
| 1879 run_message_loop_ = false; | 1886 run_message_loop_ = false; |
| 1880 } | 1887 } |
| 1881 } | 1888 } |
| 1882 browser_init_.reset(); | 1889 browser_init_.reset(); |
| 1883 | 1890 |
| 1884 PostBrowserStart(); | 1891 PostBrowserStart(); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 if (base::win::GetVersion() <= base::win::VERSION_XP) | 2015 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 2009 uma_name += "_XP"; | 2016 uma_name += "_XP"; |
| 2010 | 2017 |
| 2011 uma_name += "_PreRead_"; | 2018 uma_name += "_PreRead_"; |
| 2012 uma_name += pre_read_percentage; | 2019 uma_name += pre_read_percentage; |
| 2013 AddPreReadHistogramTime(uma_name.c_str(), time); | 2020 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 2014 } | 2021 } |
| 2015 #endif | 2022 #endif |
| 2016 #endif | 2023 #endif |
| 2017 } | 2024 } |
| OLD | NEW |