| 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 22 matching lines...) Expand all Loading... |
| 33 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" | 33 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" |
| 34 #include "chrome/browser/background/background_mode_manager.h" | 34 #include "chrome/browser/background/background_mode_manager.h" |
| 35 #include "chrome/browser/browser_process_impl.h" | 35 #include "chrome/browser/browser_process_impl.h" |
| 36 #include "chrome/browser/browser_shutdown.h" | 36 #include "chrome/browser/browser_shutdown.h" |
| 37 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 37 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
| 38 #include "chrome/browser/defaults.h" | 38 #include "chrome/browser/defaults.h" |
| 39 #include "chrome/browser/extensions/default_apps_trial.h" | 39 #include "chrome/browser/extensions/default_apps_trial.h" |
| 40 #include "chrome/browser/extensions/extension_protocols.h" | 40 #include "chrome/browser/extensions/extension_protocols.h" |
| 41 #include "chrome/browser/extensions/extension_service.h" | 41 #include "chrome/browser/extensions/extension_service.h" |
| 42 #include "chrome/browser/extensions/extensions_startup.h" | 42 #include "chrome/browser/extensions/extensions_startup.h" |
| 43 #include "chrome/browser/first_run/first_run_browser_process.h" | |
| 44 #include "chrome/browser/first_run/upgrade_util.h" | 43 #include "chrome/browser/first_run/upgrade_util.h" |
| 45 #include "chrome/browser/google/google_url_tracker.h" | 44 #include "chrome/browser/google/google_url_tracker.h" |
| 46 #include "chrome/browser/google/google_util.h" | 45 #include "chrome/browser/google/google_util.h" |
| 47 #include "chrome/browser/gpu_blacklist.h" | 46 #include "chrome/browser/gpu_blacklist.h" |
| 48 #include "chrome/browser/gpu_util.h" | 47 #include "chrome/browser/gpu_util.h" |
| 49 #include "chrome/browser/instant/instant_field_trial.h" | 48 #include "chrome/browser/instant/instant_field_trial.h" |
| 50 #include "chrome/browser/jankometer.h" | 49 #include "chrome/browser/jankometer.h" |
| 51 #include "chrome/browser/language_usage_metrics.h" | 50 #include "chrome/browser/language_usage_metrics.h" |
| 52 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 51 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
| 53 #include "chrome/browser/metrics/histogram_synchronizer.h" | 52 #include "chrome/browser/metrics/histogram_synchronizer.h" |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 // so it's better to fail here than fail mysteriously elsewhere. | 1133 // so it's better to fail here than fail mysteriously elsewhere. |
| 1135 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_)) | 1134 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_)) |
| 1136 << "Must be able to get user data directory!"; | 1135 << "Must be able to get user data directory!"; |
| 1137 #endif | 1136 #endif |
| 1138 | 1137 |
| 1139 process_singleton_.reset(new ProcessSingleton(user_data_dir_)); | 1138 process_singleton_.reset(new ProcessSingleton(user_data_dir_)); |
| 1140 // Ensure ProcessSingleton won't process messages too early. It will be | 1139 // Ensure ProcessSingleton won't process messages too early. It will be |
| 1141 // unlocked in PostBrowserStart(). | 1140 // unlocked in PostBrowserStart(). |
| 1142 process_singleton_->Lock(NULL); | 1141 process_singleton_->Lock(NULL); |
| 1143 | 1142 |
| 1144 is_first_run_ = first_run::IsChromeFirstRun() || | 1143 is_first_run_ = |
| 1145 parsed_command_line().HasSwitch(switches::kFirstRun); | 1144 (first_run::IsChromeFirstRun() || |
| 1146 | 1145 parsed_command_line().HasSwitch(switches::kFirstRun)) && |
| 1147 if (parsed_command_line().HasSwitch(switches::kImport) || | 1146 !parsed_command_line().HasSwitch(switches::kImport) && |
| 1148 parsed_command_line().HasSwitch(switches::kImportFromFile)) { | 1147 !parsed_command_line().HasSwitch(switches::kImportFromFile); |
| 1149 // We use different BrowserProcess when importing so no GoogleURLTracker is | 1148 browser_process_.reset(new BrowserProcessImpl(parsed_command_line())); |
| 1150 // instantiated (as it makes a net::URLRequest and we don't have an IO | |
| 1151 // thread, see bug #1292702). | |
| 1152 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line())); | |
| 1153 is_first_run_ = false; | |
| 1154 } else { | |
| 1155 browser_process_.reset(new BrowserProcessImpl(parsed_command_line())); | |
| 1156 } | |
| 1157 | 1149 |
| 1158 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) { | 1150 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) { |
| 1159 // User wants to override default tracking status. | 1151 // User wants to override default tracking status. |
| 1160 std::string flag = | 1152 std::string flag = |
| 1161 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling); | 1153 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling); |
| 1162 // Default to basic profiling (no parent child support). | 1154 // Default to basic profiling (no parent child support). |
| 1163 tracked_objects::ThreadData::Status status = | 1155 tracked_objects::ThreadData::Status status = |
| 1164 tracked_objects::ThreadData::PROFILING_ACTIVE; | 1156 tracked_objects::ThreadData::PROFILING_ACTIVE; |
| 1165 if (flag.compare("0") != 0) | 1157 if (flag.compare("0") != 0) |
| 1166 status = tracked_objects::ThreadData::DEACTIVATED; | 1158 status = tracked_objects::ThreadData::DEACTIVATED; |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1959 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1951 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1960 uma_name += "_XP"; | 1952 uma_name += "_XP"; |
| 1961 | 1953 |
| 1962 uma_name += "_PreRead_"; | 1954 uma_name += "_PreRead_"; |
| 1963 uma_name += pre_read_percentage; | 1955 uma_name += pre_read_percentage; |
| 1964 AddPreReadHistogramTime(uma_name.c_str(), time); | 1956 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1965 } | 1957 } |
| 1966 #endif | 1958 #endif |
| 1967 #endif | 1959 #endif |
| 1968 } | 1960 } |
| OLD | NEW |