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

Unified Diff: chrome/installer/setup/install.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: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/install.cc
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index ffd0f2b055db97a726f85846a1b7f13a0c8d5437..152ccb3ad8fbb16a07cc845f8bc2cdd7e2fb76ca 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -552,4 +552,34 @@ InstallStatus InstallOrUpdateProduct(
return result;
}
+InstallStatus OnOsUpgrade(const InstallationState& original_state,
grt (UTC plus 2) 2012/08/21 20:32:55 since this does work specifically for the browser,
huangs 2012/08/21 22:00:43 Renamed to ChromeBrowserOnOsUpgrade() (to match Ad
+ const InstallerState& installer_state,
+ const CommandLine& cmd_line) {
+ const Product* chrome_install =
+ installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER);
+ DCHECK(chrome_install);
+
+ const FilePath& setup_exe = cmd_line.GetProgram();
+ base::win::Version win_version = base::win::GetVersion();
+
+ // Upon upgrading to Windows 8, we need to fix Chrome shortcuts and register
+ // Chrome, so that Metro Chrome would work if Chrome is the default browser.
+ if (win_version >= base::win::VERSION_WIN8) {
+ // Trigger error on next OS upgrade, so we can review if this is needed.
+ DCHECK(win_version == base::win::VERSION_WIN8);
+
+ VLOG(1) << "Updating and registering shortcut for Windows 8.";
+ uint32 shortcut_options = ShellUtil::SHORTCUT_DUAL_MODE;
+ CreateOrUpdateDesktopAndQuickLaunchShortcuts(
+ installer_state, *chrome_install, shortcut_options);
+ CreateOrUpdateStartMenuAndTaskbarShortcuts(
+ installer_state, setup_exe, *chrome_install, shortcut_options);
+ RegisterChromeOnMachine(installer_state, *chrome_install, false);
+ }
+
+ // Insert new update tasks on OS upgrade here.
+
+ return installer::ON_OS_UPGRADE_SUCCESSFUL;
+}
+
} // namespace installer

Powered by Google App Engine
This is Rietveld 408576698