| 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;
|
|
|