Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/installer/setup/setup_main.cc

Issue 10823437: Callback flow to register Chrome and update shortcuts after OS upgrade to Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactoring; renamed OnOsUpgrade() to HandleOsUpgradeForBrowser(). Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <windows.h> 5 #include <windows.h>
6 #include <msi.h> 6 #include <msi.h>
7 #include <shellapi.h> 7 #include <shellapi.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 } 1163 }
1164 installer::InstallStatus tmp = installer::UNKNOWN_STATUS; 1164 installer::InstallStatus tmp = installer::UNKNOWN_STATUS;
1165 const Product* chrome_install = 1165 const Product* chrome_install =
1166 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER); 1166 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER);
1167 DCHECK(chrome_install); 1167 DCHECK(chrome_install);
1168 if (chrome_install) { 1168 if (chrome_install) {
1169 installer::DeleteChromeRegistrationKeys(chrome_install->distribution(), 1169 installer::DeleteChromeRegistrationKeys(chrome_install->distribution(),
1170 HKEY_LOCAL_MACHINE, suffix, installer_state->target_path(), &tmp); 1170 HKEY_LOCAL_MACHINE, suffix, installer_state->target_path(), &tmp);
1171 } 1171 }
1172 *exit_code = tmp; 1172 *exit_code = tmp;
1173 } else if (cmd_line.HasSwitch(installer::switches::kOnOsUpgrade)) {
1174 const Product* chrome_install =
1175 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER);
1176 if (chrome_install) {
1177 if (installer::HandleOsUpgradeForBrowser(*installer_state,
gab 2012/08/30 17:55:19 Instead of using a double if with the same else bl
huangs 2012/08/30 20:14:22 Done.
1178 *chrome_install,
1179 cmd_line.GetProgram())) {
1180 *exit_code = 0; // Success.
1181 } else {
1182 *exit_code = installer::UNKNOWN_STATUS;
grt (UTC plus 2) 2012/08/30 19:10:18 aaah. now i see why you wanted to add a new Insta
huangs 2012/08/30 20:14:22 Discussed with gab. Now adding installer::HANDLE_
1183 }
1184 } else {
1185 *exit_code = installer::UNKNOWN_STATUS;
1186 }
1173 } else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) { 1187 } else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) {
1174 // Launch the inactive user toast experiment. 1188 // Launch the inactive user toast experiment.
1175 int flavor = -1; 1189 int flavor = -1;
1176 base::StringToInt(cmd_line.GetSwitchValueNative( 1190 base::StringToInt(cmd_line.GetSwitchValueNative(
1177 installer::switches::kInactiveUserToast), &flavor); 1191 installer::switches::kInactiveUserToast), &flavor);
1178 std::string experiment_group = 1192 std::string experiment_group =
1179 cmd_line.GetSwitchValueASCII(installer::switches::kExperimentGroup); 1193 cmd_line.GetSwitchValueASCII(installer::switches::kExperimentGroup);
1180 DCHECK_NE(-1, flavor); 1194 DCHECK_NE(-1, flavor);
1181 if (flavor == -1) { 1195 if (flavor == -1) {
1182 *exit_code = installer::UNKNOWN_STATUS; 1196 *exit_code = installer::UNKNOWN_STATUS;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 if (!(installer_state.is_msi() && is_uninstall)) 1513 if (!(installer_state.is_msi() && is_uninstall))
1500 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1514 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1501 // to pass through, since this is only returned on uninstall which is 1515 // to pass through, since this is only returned on uninstall which is
1502 // never invoked directly by Google Update. 1516 // never invoked directly by Google Update.
1503 return_code = InstallUtil::GetInstallReturnCode(install_status); 1517 return_code = InstallUtil::GetInstallReturnCode(install_status);
1504 1518
1505 VLOG(1) << "Installation complete, returning: " << return_code; 1519 VLOG(1) << "Installation complete, returning: " << return_code;
1506 1520
1507 return return_code; 1521 return return_code;
1508 } 1522 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698