| 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 <set> | 10 #include <set> |
| (...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 // (requires supporting early exit). | 1674 // (requires supporting early exit). |
| 1675 PostProfileInit(); | 1675 PostProfileInit(); |
| 1676 | 1676 |
| 1677 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 1677 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
| 1678 // Show the First Run UI if this is the first time Chrome has been run on | 1678 // Show the First Run UI if this is the first time Chrome has been run on |
| 1679 // this computer, or we're being compelled to do so by a command line flag. | 1679 // this computer, or we're being compelled to do so by a command line flag. |
| 1680 // Note that this be done _after_ the PrefService is initialized and all | 1680 // Note that this be done _after_ the PrefService is initialized and all |
| 1681 // preferences are registered, since some of the code that the importer | 1681 // preferences are registered, since some of the code that the importer |
| 1682 // touches reads preferences. | 1682 // touches reads preferences. |
| 1683 if (first_run::IsChromeFirstRun()) { | 1683 if (first_run::IsChromeFirstRun()) { |
| 1684 // By default Auto Import is performed on first run. | 1684 first_run::AutoImport(profile_, master_prefs_->import_bookmarks_path); |
| 1685 bool auto_import = true; | |
| 1686 | |
| 1687 #if defined(OS_WIN) | |
| 1688 // Auto Import might be disabled via a field trial. However, this field | |
| 1689 // trial is not intended to affect enterprise users. | |
| 1690 auto_import = | |
| 1691 base::win::IsEnterpriseManaged() || | |
| 1692 !base::FeatureList::IsEnabled(features::kDisableFirstRunAutoImportWin); | |
| 1693 #endif // defined(OS_WIN) | |
| 1694 | |
| 1695 if (auto_import) { | |
| 1696 first_run::AutoImport(profile_, master_prefs_->homepage_defined, | |
| 1697 master_prefs_->do_import_items, | |
| 1698 master_prefs_->dont_import_items, | |
| 1699 master_prefs_->import_bookmarks_path); | |
| 1700 } | |
| 1701 | 1685 |
| 1702 // Note: this can pop the first run consent dialog on linux. | 1686 // Note: this can pop the first run consent dialog on linux. |
| 1703 first_run::DoPostImportTasks(profile_, | 1687 first_run::DoPostImportTasks(profile_, |
| 1704 master_prefs_->make_chrome_default_for_user); | 1688 master_prefs_->make_chrome_default_for_user); |
| 1705 | 1689 |
| 1706 if (!master_prefs_->suppress_first_run_default_browser_prompt) { | 1690 if (!master_prefs_->suppress_first_run_default_browser_prompt) { |
| 1707 browser_creator_->set_show_main_browser_window( | 1691 browser_creator_->set_show_main_browser_window( |
| 1708 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); | 1692 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); |
| 1709 } else { | 1693 } else { |
| 1710 browser_creator_->set_is_default_browser_dialog_suppressed(true); | 1694 browser_creator_->set_is_default_browser_dialog_suppressed(true); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2101 chromeos::CrosSettings::Shutdown(); | 2085 chromeos::CrosSettings::Shutdown(); |
| 2102 #endif // defined(OS_CHROMEOS) | 2086 #endif // defined(OS_CHROMEOS) |
| 2103 #endif // defined(OS_ANDROID) | 2087 #endif // defined(OS_ANDROID) |
| 2104 } | 2088 } |
| 2105 | 2089 |
| 2106 // Public members: | 2090 // Public members: |
| 2107 | 2091 |
| 2108 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2092 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2109 chrome_extra_parts_.push_back(parts); | 2093 chrome_extra_parts_.push_back(parts); |
| 2110 } | 2094 } |
| OLD | NEW |