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 19 matching lines...) Expand all Loading... |
30 #include "base/utf_string_conversions.h" | 30 #include "base/utf_string_conversions.h" |
31 #include "base/values.h" | 31 #include "base/values.h" |
32 #include "build/build_config.h" | 32 #include "build/build_config.h" |
33 #include "chrome/browser/about_flags.h" | 33 #include "chrome/browser/about_flags.h" |
34 #include "chrome/browser/auto_launch_trial.h" | 34 #include "chrome/browser/auto_launch_trial.h" |
35 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" | 35 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" |
36 #include "chrome/browser/browser_process.h" | 36 #include "chrome/browser/browser_process.h" |
37 #include "chrome/browser/browser_process_impl.h" | 37 #include "chrome/browser/browser_process_impl.h" |
38 #include "chrome/browser/browser_shutdown.h" | 38 #include "chrome/browser/browser_shutdown.h" |
39 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 39 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
| 40 #include "chrome/browser/chrome_select_file_policy.h" |
40 #include "chrome/browser/defaults.h" | 41 #include "chrome/browser/defaults.h" |
41 #include "chrome/browser/extensions/default_apps_trial.h" | 42 #include "chrome/browser/extensions/default_apps_trial.h" |
42 #include "chrome/browser/extensions/extension_protocols.h" | 43 #include "chrome/browser/extensions/extension_protocols.h" |
43 #include "chrome/browser/extensions/extension_service.h" | 44 #include "chrome/browser/extensions/extension_service.h" |
44 #include "chrome/browser/extensions/extensions_startup.h" | 45 #include "chrome/browser/extensions/extensions_startup.h" |
45 #include "chrome/browser/first_run/upgrade_util.h" | 46 #include "chrome/browser/first_run/upgrade_util.h" |
46 #include "chrome/browser/google/google_search_counter.h" | 47 #include "chrome/browser/google/google_search_counter.h" |
47 #include "chrome/browser/google/google_util.h" | 48 #include "chrome/browser/google/google_util.h" |
48 #include "chrome/browser/gpu_blacklist.h" | 49 #include "chrome/browser/gpu_blacklist.h" |
49 #include "chrome/browser/gpu_util.h" | 50 #include "chrome/browser/gpu_util.h" |
(...skipping 25 matching lines...) Expand all Loading... |
75 #include "chrome/browser/search_engines/search_engine_type.h" | 76 #include "chrome/browser/search_engines/search_engine_type.h" |
76 #include "chrome/browser/search_engines/template_url.h" | 77 #include "chrome/browser/search_engines/template_url.h" |
77 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 78 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
78 #include "chrome/browser/search_engines/template_url_service.h" | 79 #include "chrome/browser/search_engines/template_url_service.h" |
79 #include "chrome/browser/search_engines/template_url_service_factory.h" | 80 #include "chrome/browser/search_engines/template_url_service_factory.h" |
80 #include "chrome/browser/service/service_process_control.h" | 81 #include "chrome/browser/service/service_process_control.h" |
81 #include "chrome/browser/shell_integration.h" | 82 #include "chrome/browser/shell_integration.h" |
82 #include "chrome/browser/translate/translate_manager.h" | 83 #include "chrome/browser/translate/translate_manager.h" |
83 #include "chrome/browser/ui/browser.h" | 84 #include "chrome/browser/ui/browser.h" |
84 #include "chrome/browser/ui/browser_finder.h" | 85 #include "chrome/browser/ui/browser_finder.h" |
| 86 #include "chrome/browser/ui/select_file_dialog.h" |
85 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 87 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
86 #include "chrome/browser/ui/user_data_dir_dialog.h" | 88 #include "chrome/browser/ui/user_data_dir_dialog.h" |
87 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 89 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
88 #include "chrome/common/child_process_logging.h" | 90 #include "chrome/common/child_process_logging.h" |
89 #include "chrome/common/chrome_constants.h" | 91 #include "chrome/common/chrome_constants.h" |
90 #include "chrome/common/chrome_paths.h" | 92 #include "chrome/common/chrome_paths.h" |
91 #include "chrome/common/chrome_result_codes.h" | 93 #include "chrome/common/chrome_result_codes.h" |
92 #include "chrome/common/chrome_switches.h" | 94 #include "chrome/common/chrome_switches.h" |
93 #include "chrome/common/chrome_version_info.h" | 95 #include "chrome/common/chrome_version_info.h" |
94 #include "chrome/common/env_vars.h" | 96 #include "chrome/common/env_vars.h" |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 // needed on Android as there aren't experimental flags. | 1254 // needed on Android as there aren't experimental flags. |
1253 about_flags::ConvertFlagsToSwitches(local_state_, | 1255 about_flags::ConvertFlagsToSwitches(local_state_, |
1254 CommandLine::ForCurrentProcess()); | 1256 CommandLine::ForCurrentProcess()); |
1255 #endif | 1257 #endif |
1256 local_state_->UpdateCommandLinePrefStore(CommandLine::ForCurrentProcess()); | 1258 local_state_->UpdateCommandLinePrefStore(CommandLine::ForCurrentProcess()); |
1257 | 1259 |
1258 // Reset the command line in the crash report details, since we may have | 1260 // Reset the command line in the crash report details, since we may have |
1259 // just changed it to include experiments. | 1261 // just changed it to include experiments. |
1260 child_process_logging::SetCommandLine(CommandLine::ForCurrentProcess()); | 1262 child_process_logging::SetCommandLine(CommandLine::ForCurrentProcess()); |
1261 | 1263 |
| 1264 // We should check chrome policy before spawning a dialog. |
| 1265 SelectFileDialog::SetFilePolicy(new ChromeSelectFilePolicy); |
| 1266 |
1262 // If we're running tests (ui_task is non-null), then the ResourceBundle | 1267 // If we're running tests (ui_task is non-null), then the ResourceBundle |
1263 // has already been initialized. | 1268 // has already been initialized. |
1264 if (parameters().ui_task) { | 1269 if (parameters().ui_task) { |
1265 browser_process_->SetApplicationLocale("en-US"); | 1270 browser_process_->SetApplicationLocale("en-US"); |
1266 } else { | 1271 } else { |
1267 // Mac starts it earlier in |PreMainMessageLoopStart()| (because it is | 1272 // Mac starts it earlier in |PreMainMessageLoopStart()| (because it is |
1268 // needed when loading the MainMenu.nib and the language doesn't depend on | 1273 // needed when loading the MainMenu.nib and the language doesn't depend on |
1269 // anything since it comes from Cocoa. | 1274 // anything since it comes from Cocoa. |
1270 #if defined(OS_MACOSX) | 1275 #if defined(OS_MACOSX) |
1271 browser_process_->SetApplicationLocale(l10n_util::GetLocaleOverride()); | 1276 browser_process_->SetApplicationLocale(l10n_util::GetLocaleOverride()); |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 if (base::win::GetVersion() <= base::win::VERSION_XP) | 2027 if (base::win::GetVersion() <= base::win::VERSION_XP) |
2023 uma_name += "_XP"; | 2028 uma_name += "_XP"; |
2024 | 2029 |
2025 uma_name += "_PreRead_"; | 2030 uma_name += "_PreRead_"; |
2026 uma_name += pre_read_percentage; | 2031 uma_name += pre_read_percentage; |
2027 AddPreReadHistogramTime(uma_name.c_str(), time); | 2032 AddPreReadHistogramTime(uma_name.c_str(), time); |
2028 } | 2033 } |
2029 #endif | 2034 #endif |
2030 #endif | 2035 #endif |
2031 } | 2036 } |
OLD | NEW |