| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 if (CheckMachineLevelInstall()) | 626 if (CheckMachineLevelInstall()) |
| 627 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; | 627 return ResultCodes::MACHINE_LEVEL_INSTALL_EXISTS; |
| 628 | 628 |
| 629 process_singleton.Create(); | 629 process_singleton.Create(); |
| 630 | 630 |
| 631 // Show the First Run UI if this is the first time Chrome has been run on | 631 // Show the First Run UI if this is the first time Chrome has been run on |
| 632 // this computer, or we're being compelled to do so by a command line flag. | 632 // this computer, or we're being compelled to do so by a command line flag. |
| 633 // Note that this be done _after_ the PrefService is initialized and all | 633 // Note that this be done _after_ the PrefService is initialized and all |
| 634 // preferences are registered, since some of the code that the importer | 634 // preferences are registered, since some of the code that the importer |
| 635 // touches reads preferences. | 635 // touches reads preferences. |
| 636 if (is_first_run && !first_run_ui_bypass) { | 636 if (is_first_run) { |
| 637 if (!OpenFirstRunDialog(profile, homepage_defined, &process_singleton)) { | 637 if (!first_run_ui_bypass) { |
| 638 // The user cancelled the first run dialog box, we should exit Chrome. | 638 if (!OpenFirstRunDialog(profile, homepage_defined, &process_singleton)) { |
| 639 return ResultCodes::NORMAL_EXIT; | 639 // The user cancelled the first run dialog box, we should exit Chrome. |
| 640 return ResultCodes::NORMAL_EXIT; |
| 641 } |
| 642 #if defined(OS_POSIX) |
| 643 // On Windows, the download is tagged with enable/disable stats so there |
| 644 // is no need for this code. |
| 645 |
| 646 // If stats reporting was turned on by the first run dialog then toggle |
| 647 // the pref. |
| 648 if (GoogleUpdateSettings::GetCollectStatsConsent()) |
| 649 local_state->SetBoolean(prefs::kMetricsReportingEnabled, true); |
| 650 #endif // OS_POSIX |
| 640 } | 651 } |
| 641 #if defined(OS_POSIX) | 652 Browser::SetNewHomePagePrefs(user_prefs); |
| 642 // On Windows, the download is tagged with enable/disable stats so there | |
| 643 // is no need for this code. | |
| 644 | |
| 645 // If stats reporting was turned on by the first run dialog then toggle | |
| 646 // the pref. | |
| 647 if (GoogleUpdateSettings::GetCollectStatsConsent()) | |
| 648 local_state->SetBoolean(prefs::kMetricsReportingEnabled, true); | |
| 649 #endif // OS_POSIX | |
| 650 } | 653 } |
| 651 | 654 |
| 652 // Sets things up so that if we crash from this point on, a dialog will | 655 // Sets things up so that if we crash from this point on, a dialog will |
| 653 // popup asking the user to restart chrome. It is done this late to avoid | 656 // popup asking the user to restart chrome. It is done this late to avoid |
| 654 // testing against a bunch of special cases that are taken care early on. | 657 // testing against a bunch of special cases that are taken care early on. |
| 655 PrepareRestartOnCrashEnviroment(parsed_command_line); | 658 PrepareRestartOnCrashEnviroment(parsed_command_line); |
| 656 | 659 |
| 657 #if defined(OS_WIN) | 660 #if defined(OS_WIN) |
| 658 // Initialize Winsock. | 661 // Initialize Winsock. |
| 659 net::EnsureWinsockInit(); | 662 net::EnsureWinsockInit(); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 if (metrics) | 835 if (metrics) |
| 833 metrics->Stop(); | 836 metrics->Stop(); |
| 834 | 837 |
| 835 // browser_shutdown takes care of deleting browser_process, so we need to | 838 // browser_shutdown takes care of deleting browser_process, so we need to |
| 836 // release it. | 839 // release it. |
| 837 browser_process.release(); | 840 browser_process.release(); |
| 838 browser_shutdown::Shutdown(); | 841 browser_shutdown::Shutdown(); |
| 839 | 842 |
| 840 return result_code; | 843 return result_code; |
| 841 } | 844 } |
| OLD | NEW |