Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <shlobj.h> | 5 #include <shlobj.h> |
| 6 #include <time.h> | 6 #include <time.h> |
| 7 | 7 |
| 8 #include "chrome/installer/setup/install.h" | 8 #include "chrome/installer/setup/install.h" |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 766 if (!CreateOrUpdateChromeShortcuts(exe_path, install_path, | 766 if (!CreateOrUpdateChromeShortcuts(exe_path, install_path, |
| 767 new_version.GetString(), result, | 767 new_version.GetString(), result, |
| 768 system_install, create_all_shortcut, | 768 system_install, create_all_shortcut, |
| 769 alt_shortcut)) | 769 alt_shortcut)) |
| 770 LOG(WARNING) << "Failed to create/update start menu shortcut."; | 770 LOG(WARNING) << "Failed to create/update start menu shortcut."; |
| 771 | 771 |
| 772 bool make_chrome_default = false; | 772 bool make_chrome_default = false; |
| 773 installer_util::GetDistroBooleanPreference(prefs, | 773 installer_util::GetDistroBooleanPreference(prefs, |
| 774 installer_util::master_preferences::kMakeChromeDefault, | 774 installer_util::master_preferences::kMakeChromeDefault, |
| 775 &make_chrome_default); | 775 &make_chrome_default); |
| 776 | |
| 777 // If this is not the user's first Chrome install, but they have chosen | |
| 778 // Chrome to become their default browser on the download page, we must | |
| 779 // force it here because the master_preferences file will not get copied | |
| 780 // into the build. | |
| 781 bool force_chrome_default_for_user = false; | |
| 782 if (result == installer_util::NEW_VERSION_UPDATED || | |
| 783 result == installer_util::IN_USE_UPDATED || | |
|
huanr
2010/09/02 02:30:12
Did you update the CL? I still see IN_USE_UPDATED.
| |
| 784 result == installer_util::INSTALL_REPAIRED) { | |
| 785 installer_util::GetDistroBooleanPreference(prefs, | |
| 786 installer_util::master_preferences::kMakeChromeDefaultForUser, | |
| 787 &force_chrome_default_for_user); | |
| 788 } | |
| 789 | |
| 776 RegisterChromeOnMachine(install_path, system_install, | 790 RegisterChromeOnMachine(install_path, system_install, |
| 777 make_chrome_default); | 791 make_chrome_default || force_chrome_default_for_user); |
| 778 } | 792 } |
| 779 | 793 |
| 780 std::wstring latest_version_to_keep(new_version.GetString()); | 794 std::wstring latest_version_to_keep(new_version.GetString()); |
| 781 if (!current_version.empty()) | 795 if (!current_version.empty()) |
| 782 latest_version_to_keep.assign(current_version); | 796 latest_version_to_keep.assign(current_version); |
| 783 RemoveOldVersionDirs(install_path, latest_version_to_keep); | 797 RemoveOldVersionDirs(install_path, latest_version_to_keep); |
| 784 } | 798 } |
| 785 | 799 |
| 786 return result; | 800 return result; |
| 787 } | 801 } |
| OLD | NEW |