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

Unified Diff: chrome/installer/setup/setup_main.cc

Issue 10889028: Install a user-level Start Menu shortcut for every user on system-installs through Active Setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove TODO for Notify 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/setup_main.cc
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 472cb2a0a5371638c53799b0f8b7893d7851c08b..1d85d762089c82c469ec425c0aa91929c89a7958 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -1033,6 +1033,10 @@ bool HandleNonInstallCmdLineOptions(const InstallationState& original_state,
const CommandLine& cmd_line,
InstallerState* installer_state,
int* exit_code) {
+ // TODO(gab): Add a local |status| variable which each block below sets;
+ // only determine the |exit_code| from |status| at the end (this will allow
+ // this method to validate that
+ // (!handled || status != installer::UNKNOWN_STATUS)).
bool handled = true;
// TODO(tommi): Split these checks up into functions and use a data driven
// map of switch->function.
@@ -1090,12 +1094,27 @@ bool HandleNonInstallCmdLineOptions(const InstallationState& original_state,
}
} else if (cmd_line.HasSwitch(
installer::switches::kConfigureUserSettings)) {
- DCHECK(installer_state->system_install());
+ // NOTE: Should the work done here, on kConfigureUserSettings, change:
+ // kActiveSetupVersion in install_worker.cc needs to be increased for Active
+ // Setup to invoke this again for all users of this install.
const Product* chrome_install =
installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER);
- DCHECK(chrome_install);
- // TODO(gab): Implement the new shortcut functionality here.
- LOG(ERROR) << "--configure-user-settings is not implemented.";
+
+ // Create per-user Start Menu shortcuts.
+ // TODO(gab): This should really be more involved, but for now creating
+ // the shortcut and leaving it non-updated in later updates is fine.
+ // This is all coming in an upcoming refactoring of the shortcuts, but for
+ // now this will simply create the user-level shortcut once on the first
+ // (and only) invocation of Active Setup for Chrome for this user.
+ installer::InstallStatus status = installer::INVALID_STATE_FOR_OPTION;
+ if (chrome_install && installer_state->system_install()) {
+ ForceCreateUserLevelStartMenuShortcut(*installer_state, *chrome_install);
+ status = installer::INSTALL_REPAIRED;
+ } else {
+ LOG(DFATAL) << "chrome_install:" << chrome_install
+ << ", system_install:" << installer_state->system_install();
+ }
+ *exit_code = InstallUtil::GetInstallReturnCode(status);
} else if (cmd_line.HasSwitch(
installer::switches::kRegisterChromeBrowser)) {
installer::InstallStatus status = installer::UNKNOWN_STATUS;
@@ -1173,12 +1192,16 @@ bool HandleNonInstallCmdLineOptions(const InstallationState& original_state,
} else if (cmd_line.HasSwitch(installer::switches::kOnOsUpgrade)) {
const Product* chrome_install =
installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER);
+ installer::InstallStatus status = installer::INVALID_STATE_FOR_OPTION;
if (chrome_install) {
installer::HandleOsUpgradeForBrowser(*installer_state,
*chrome_install,
cmd_line.GetProgram());
+ status = installer::INSTALL_REPAIRED;
+ } else {
+ LOG(DFATAL) << "Chrome product not found.";
}
- *exit_code = InstallUtil::GetInstallReturnCode(installer::INSTALL_REPAIRED);
+ *exit_code = InstallUtil::GetInstallReturnCode(status);
} else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) {
// Launch the inactive user toast experiment.
int flavor = -1;

Powered by Google App Engine
This is Rietveld 408576698