Index: chrome/installer/setup/setup_main.cc |
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc |
index 2562be0823834d3ce13bf9d6b7e10409e77473cd..ef260e2dda60affc8d339cfe610aeb3d78c56ccc 100644 |
--- a/chrome/installer/setup/setup_main.cc |
+++ b/chrome/installer/setup/setup_main.cc |
@@ -1199,6 +1199,23 @@ bool HandleNonInstallCmdLineOptions(const InstallationState& original_state, |
} else { |
*exit_code = installer::PATCH_INVALID_ARGUMENTS; |
} |
+ } else if (cmd_line.HasSwitch(installer::switches::kReenableAutoupdates)) { |
+ // setup.exe has been asked to attempt to reenable updates for Chrome. |
+ // Figure out whether we should do so for the multi binaries or the main |
+ // Chrome product. |
+ const ProductState* chrome_state = original_state.GetProductState( |
+ installer_state->system_install(), BrowserDistribution::CHROME_BROWSER); |
+ |
+ BrowserDistribution::Type dist_type = BrowserDistribution::CHROME_BROWSER; |
+ if (chrome_state && chrome_state->is_multi_install()) |
+ dist_type = BrowserDistribution::CHROME_BINARIES; |
+ |
+ BrowserDistribution* dist = |
+ BrowserDistribution::GetSpecificDistribution(dist_type); |
+ bool updates_enabled = |
+ GoogleUpdateSettings::ReenableAutoupdatesForApp(dist->GetAppGuid()); |
+ *exit_code = updates_enabled ? installer::REENABLE_UPDATES_SUCCEEDED : |
+ installer::REENABLE_UPDATES_FAILED; |
} else { |
handled = false; |
} |