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

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

Issue 216153006: Invoke setup.exe to reenable updates when the update bubble is clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mad2
Patch Set: MAD's feedback. Created 6 years, 9 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 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;
}

Powered by Google App Engine
This is Rietveld 408576698