| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 #include "chromeos/settings/cros_settings_names.h" | 199 #include "chromeos/settings/cros_settings_names.h" |
| 200 #endif // defined(OS_CHROMEOS) | 200 #endif // defined(OS_CHROMEOS) |
| 201 | 201 |
| 202 // 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 |
| 203 // 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 |
| 204 // 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 |
| 205 // 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. |
| 206 | 206 |
| 207 #if defined(OS_WIN) | 207 #if defined(OS_WIN) |
| 208 #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" |
| 209 #include "base/win/windows_version.h" | 210 #include "base/win/windows_version.h" |
| 210 #include "chrome/app/file_pre_reader_win.h" | 211 #include "chrome/app/file_pre_reader_win.h" |
| 211 #include "chrome/browser/chrome_browser_main_win.h" | 212 #include "chrome/browser/chrome_browser_main_win.h" |
| 212 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" | 213 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" |
| 213 #include "chrome/browser/downgrade/user_data_downgrade.h" | 214 #include "chrome/browser/downgrade/user_data_downgrade.h" |
| 214 #include "chrome/browser/first_run/try_chrome_dialog_view.h" | 215 #include "chrome/browser/first_run/try_chrome_dialog_view.h" |
| 215 #include "chrome/browser/first_run/upgrade_util_win.h" | 216 #include "chrome/browser/first_run/upgrade_util_win.h" |
| 216 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 217 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 217 #include "chrome/browser/ui/network_profile_bubble.h" | 218 #include "chrome/browser/ui/network_profile_bubble.h" |
| 218 #include "chrome/browser/win/browser_util.h" | 219 #include "chrome/browser/win/browser_util.h" |
| (...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1806 // (requires supporting early exit). | 1807 // (requires supporting early exit). |
| 1807 PostProfileInit(); | 1808 PostProfileInit(); |
| 1808 | 1809 |
| 1809 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 1810 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
| 1810 // Show the First Run UI if this is the first time Chrome has been run on | 1811 // Show the First Run UI if this is the first time Chrome has been run on |
| 1811 // this computer, or we're being compelled to do so by a command line flag. | 1812 // this computer, or we're being compelled to do so by a command line flag. |
| 1812 // Note that this be done _after_ the PrefService is initialized and all | 1813 // Note that this be done _after_ the PrefService is initialized and all |
| 1813 // preferences are registered, since some of the code that the importer | 1814 // preferences are registered, since some of the code that the importer |
| 1814 // touches reads preferences. | 1815 // touches reads preferences. |
| 1815 if (first_run::IsChromeFirstRun()) { | 1816 if (first_run::IsChromeFirstRun()) { |
| 1816 first_run::AutoImport(profile_, | 1817 // By default Auto Import is performed on first run. |
| 1817 master_prefs_->homepage_defined, | 1818 bool auto_import = true; |
| 1818 master_prefs_->do_import_items, | 1819 |
| 1819 master_prefs_->dont_import_items, | 1820 #if defined(OS_WIN) |
| 1820 master_prefs_->import_bookmarks_path); | 1821 // Auto Import might be disabled via a field trial. However, this field |
| 1822 // trial is not intended to affect enterprise users. |
| 1823 auto_import = |
| 1824 base::win::IsEnrolledToDomain() || |
| 1825 !base::FeatureList::IsEnabled(features::kDisableFirstRunAutoImportWin); |
| 1826 #endif // defined(OS_WIN) |
| 1827 |
| 1828 if (auto_import) { |
| 1829 first_run::AutoImport(profile_, master_prefs_->homepage_defined, |
| 1830 master_prefs_->do_import_items, |
| 1831 master_prefs_->dont_import_items, |
| 1832 master_prefs_->import_bookmarks_path); |
| 1833 } |
| 1821 | 1834 |
| 1822 // Note: this can pop the first run consent dialog on linux. | 1835 // Note: this can pop the first run consent dialog on linux. |
| 1823 first_run::DoPostImportTasks(profile_, | 1836 first_run::DoPostImportTasks(profile_, |
| 1824 master_prefs_->make_chrome_default_for_user); | 1837 master_prefs_->make_chrome_default_for_user); |
| 1825 | 1838 |
| 1826 if (!master_prefs_->suppress_first_run_default_browser_prompt) { | 1839 if (!master_prefs_->suppress_first_run_default_browser_prompt) { |
| 1827 browser_creator_->set_show_main_browser_window( | 1840 browser_creator_->set_show_main_browser_window( |
| 1828 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); | 1841 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); |
| 1829 } else { | 1842 } else { |
| 1830 browser_creator_->set_is_default_browser_dialog_suppressed(true); | 1843 browser_creator_->set_is_default_browser_dialog_suppressed(true); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 chromeos::CrosSettings::Shutdown(); | 2237 chromeos::CrosSettings::Shutdown(); |
| 2225 #endif // defined(OS_CHROMEOS) | 2238 #endif // defined(OS_CHROMEOS) |
| 2226 #endif // defined(OS_ANDROID) | 2239 #endif // defined(OS_ANDROID) |
| 2227 } | 2240 } |
| 2228 | 2241 |
| 2229 // Public members: | 2242 // Public members: |
| 2230 | 2243 |
| 2231 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2244 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2232 chrome_extra_parts_.push_back(parts); | 2245 chrome_extra_parts_.push_back(parts); |
| 2233 } | 2246 } |
| OLD | NEW |