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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 15 matching lines...) Expand all Loading... | |
26 #include "base/logging.h" | 26 #include "base/logging.h" |
27 #include "base/memory/ptr_util.h" | 27 #include "base/memory/ptr_util.h" |
28 #include "base/metrics/field_trial.h" | 28 #include "base/metrics/field_trial.h" |
29 #include "base/metrics/histogram_macros.h" | 29 #include "base/metrics/histogram_macros.h" |
30 #include "base/path_service.h" | 30 #include "base/path_service.h" |
31 #include "base/profiler/scoped_tracker.h" | 31 #include "base/profiler/scoped_tracker.h" |
32 #include "base/run_loop.h" | 32 #include "base/run_loop.h" |
33 #include "base/strings/string_number_conversions.h" | 33 #include "base/strings/string_number_conversions.h" |
34 #include "base/strings/string_piece.h" | 34 #include "base/strings/string_piece.h" |
35 #include "base/strings/string_split.h" | 35 #include "base/strings/string_split.h" |
36 #include "base/strings/string_util.h" | |
36 #include "base/strings/sys_string_conversions.h" | 37 #include "base/strings/sys_string_conversions.h" |
37 #include "base/strings/utf_string_conversions.h" | 38 #include "base/strings/utf_string_conversions.h" |
38 #include "base/sys_info.h" | 39 #include "base/sys_info.h" |
39 #include "base/task_scheduler/scheduler_worker_pool_params.h" | 40 #include "base/task_scheduler/scheduler_worker_pool_params.h" |
40 #include "base/task_scheduler/switches.h" | 41 #include "base/task_scheduler/switches.h" |
41 #include "base/task_scheduler/task_scheduler.h" | 42 #include "base/task_scheduler/task_scheduler.h" |
42 #include "base/task_scheduler/task_traits.h" | 43 #include "base/task_scheduler/task_traits.h" |
43 #include "base/threading/platform_thread.h" | 44 #include "base/threading/platform_thread.h" |
44 #include "base/time/default_tick_clock.h" | 45 #include "base/time/default_tick_clock.h" |
45 #include "base/time/time.h" | 46 #include "base/time/time.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 #include "chromeos/settings/cros_settings_names.h" | 199 #include "chromeos/settings/cros_settings_names.h" |
199 #endif // defined(OS_CHROMEOS) | 200 #endif // defined(OS_CHROMEOS) |
200 | 201 |
201 // TODO(port): several win-only methods have been pulled out of this, but | 202 // TODO(port): several win-only methods have been pulled out of this, but |
202 // BrowserMain() as a whole needs to be broken apart so that it's usable by | 203 // BrowserMain() as a whole needs to be broken apart so that it's usable by |
203 // other platforms. For now, it's just a stub. This is a serious work in | 204 // other platforms. For now, it's just a stub. This is a serious work in |
204 // progress and should not be taken as an indication of a real refactoring. | 205 // progress and should not be taken as an indication of a real refactoring. |
205 | 206 |
206 #if defined(OS_WIN) | 207 #if defined(OS_WIN) |
207 #include "base/trace_event/trace_event_etw_export_win.h" | 208 #include "base/trace_event/trace_event_etw_export_win.h" |
209 #include "base/win/win_util.h" | |
208 #include "base/win/windows_version.h" | 210 #include "base/win/windows_version.h" |
209 #include "chrome/app/file_pre_reader_win.h" | 211 #include "chrome/app/file_pre_reader_win.h" |
210 #include "chrome/browser/chrome_browser_main_win.h" | 212 #include "chrome/browser/chrome_browser_main_win.h" |
211 #include "chrome/browser/component_updater/caps_installer_win.h" | 213 #include "chrome/browser/component_updater/caps_installer_win.h" |
212 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" | 214 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" |
213 #include "chrome/browser/downgrade/user_data_downgrade.h" | 215 #include "chrome/browser/downgrade/user_data_downgrade.h" |
214 #include "chrome/browser/first_run/try_chrome_dialog_view.h" | 216 #include "chrome/browser/first_run/try_chrome_dialog_view.h" |
215 #include "chrome/browser/first_run/upgrade_util_win.h" | 217 #include "chrome/browser/first_run/upgrade_util_win.h" |
216 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 218 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
217 #include "chrome/browser/ui/network_profile_bubble.h" | 219 #include "chrome/browser/ui/network_profile_bubble.h" |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1791 // (requires supporting early exit). | 1793 // (requires supporting early exit). |
1792 PostProfileInit(); | 1794 PostProfileInit(); |
1793 | 1795 |
1794 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 1796 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
1795 // Show the First Run UI if this is the first time Chrome has been run on | 1797 // Show the First Run UI if this is the first time Chrome has been run on |
1796 // this computer, or we're being compelled to do so by a command line flag. | 1798 // this computer, or we're being compelled to do so by a command line flag. |
1797 // Note that this be done _after_ the PrefService is initialized and all | 1799 // Note that this be done _after_ the PrefService is initialized and all |
1798 // preferences are registered, since some of the code that the importer | 1800 // preferences are registered, since some of the code that the importer |
1799 // touches reads preferences. | 1801 // touches reads preferences. |
1800 if (first_run::IsChromeFirstRun()) { | 1802 if (first_run::IsChromeFirstRun()) { |
1801 first_run::AutoImport(profile_, | 1803 // Field trial kDisableFirstRunAutoImport is designed to turn off the |
1802 master_prefs_->homepage_defined, | 1804 // Auto Import feature for Windows users (on first run). |
1803 master_prefs_->do_import_items, | 1805 // The feature keeps running for enterprise. |
Ilya Sherman
2016/08/23 21:05:33
nit: I'd phrase this as something like:
"Auto Imp
gcomanici
2016/08/26 19:02:17
Done.
| |
1804 master_prefs_->dont_import_items, | 1806 if (base::win::IsEnrolledToDomain() || |
Ilya Sherman
2016/08/23 21:05:33
Hmm, I just noticed that you're calling a "base::w
gcomanici
2016/08/26 19:02:17
From what I gather in BUG=555550, the trial is int
| |
1805 master_prefs_->import_bookmarks_path); | 1807 !base::FeatureList::IsEnabled(features::kDisableFirstRunAutoImport)) { |
1808 first_run::AutoImport(profile_, master_prefs_->homepage_defined, | |
1809 master_prefs_->do_import_items, | |
1810 master_prefs_->dont_import_items, | |
1811 master_prefs_->import_bookmarks_path); | |
1812 } | |
1806 | 1813 |
1807 // Note: this can pop the first run consent dialog on linux. | 1814 // Note: this can pop the first run consent dialog on linux. |
1808 first_run::DoPostImportTasks(profile_, | 1815 first_run::DoPostImportTasks(profile_, |
1809 master_prefs_->make_chrome_default_for_user); | 1816 master_prefs_->make_chrome_default_for_user); |
1810 | 1817 |
1811 if (!master_prefs_->suppress_first_run_default_browser_prompt) { | 1818 if (!master_prefs_->suppress_first_run_default_browser_prompt) { |
1812 browser_creator_->set_show_main_browser_window( | 1819 browser_creator_->set_show_main_browser_window( |
1813 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); | 1820 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); |
1814 } else { | 1821 } else { |
1815 browser_creator_->set_is_default_browser_dialog_suppressed(true); | 1822 browser_creator_->set_is_default_browser_dialog_suppressed(true); |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2209 chromeos::CrosSettings::Shutdown(); | 2216 chromeos::CrosSettings::Shutdown(); |
2210 #endif // defined(OS_CHROMEOS) | 2217 #endif // defined(OS_CHROMEOS) |
2211 #endif // defined(OS_ANDROID) | 2218 #endif // defined(OS_ANDROID) |
2212 } | 2219 } |
2213 | 2220 |
2214 // Public members: | 2221 // Public members: |
2215 | 2222 |
2216 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2223 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
2217 chrome_extra_parts_.push_back(parts); | 2224 chrome_extra_parts_.push_back(parts); |
2218 } | 2225 } |
OLD | NEW |