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

Unified Diff: chrome/installer/util/installation_validator.cc

Issue 869153004: Support migrating multi-install Chrome to single-install. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 5 years, 11 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/util/installation_validator.cc
diff --git a/chrome/installer/util/installation_validator.cc b/chrome/installer/util/installation_validator.cc
index b8812d33eddeae42965e310a81c4d69a690bf749..bdccf2daefe0974c6635390006fc9a068b534a8c 100644
--- a/chrome/installer/util/installation_validator.cc
+++ b/chrome/installer/util/installation_validator.cc
@@ -392,28 +392,15 @@ void InstallationValidator::ValidateBinaries(
<< "\"";
}
- // ap must have -applauncher iff Chrome App Launcher is installed multi
- const ProductState* app_host_state = machine_state.GetProductState(
- system_install, BrowserDistribution::CHROME_APP_HOST);
- if (app_host_state != NULL) {
- if (!app_host_state->is_multi_install()) {
- *is_valid = false;
- LOG(ERROR) << "Chrome App Launcher is installed in non-multi mode.";
- }
- if (!channel.IsAppLauncher()) {
- *is_valid = false;
- LOG(ERROR) << "Chrome Binaries are missing \"-applauncher\" in channel"
- " name: \"" << channel.value() << "\"";
- }
- } else if (channel.IsAppLauncher()) {
+ // ap must not have -applauncher.
+ if (channel.IsAppLauncher()) {
*is_valid = false;
- LOG(ERROR) << "Chrome Binaries have \"-applauncher\" in channel name, yet "
- "Chrome App Launcher is not installed: \"" << channel.value()
- << "\"";
+ LOG(ERROR) << "Chrome Binaries have \"-applauncher\" in channel name: \""
+ << channel.value() << "\"";
}
- // Chrome, Chrome Frame, or App Host must be present
- if (chrome_state == NULL && cf_state == NULL && app_host_state == NULL) {
+ // Chrome or Chrome Frame must be present
+ if (chrome_state == NULL && cf_state == NULL) {
*is_valid = false;
LOG(ERROR) << "Chrome Binaries are present with no other products.";
}
@@ -425,12 +412,12 @@ void InstallationValidator::ValidateBinaries(
<< "Chrome Binaries are present yet Chrome is not multi-install.";
}
- // Chrome Frame must be multi-install if Chrome & App Host are not present.
- if (cf_state != NULL && app_host_state == NULL && chrome_state == NULL &&
+ // Chrome Frame must be multi-install if Chrome is not present.
+ if (cf_state != NULL && chrome_state == NULL &&
robertshield 2015/01/28 23:17:59 can this whole check be removed given that CF has
grt (UTC plus 2) 2015/01/29 17:56:51 Yeah, there's more room for cleanup. I'll keep tha
!cf_state->is_multi_install()) {
*is_valid = false;
- LOG(ERROR) << "Chrome Binaries are present without Chrome nor App Launcher "
- << "yet Chrome Frame is not multi-install.";
+ LOG(ERROR) << "Chrome Binaries are present without Chrome yet Chrome Frame "
+ "is not multi-install.";
}
ChromeBinariesRules binaries_rules;
@@ -706,6 +693,22 @@ bool InstallationValidator::ValidateInstallationTypeForState(
ProductBits::CHROME_MULTI :
ProductBits::CHROME_SINGLE));
}
+ // Usage of the app launcher is tracked alongside Chrome.
+ const ProductState* launcher_state =
+ machine_state.GetProductState(system_level,
+ BrowserDistribution::CHROME_APP_HOST);
+ BrowserDistribution* chrome_dist =
+ BrowserDistribution::GetSpecificDistribution(
+ BrowserDistribution::CHROME_BROWSER);
+ if (!launcher_state) {
+ LOG_IF(ERROR, product_state)
+ << "App launcher is not installed with "
+ << chrome_dist->GetDisplayName();
+ } else {
+ LOG_IF(ERROR, !product_state)
+ << "App launcher is installed without "
+ << chrome_dist->GetDisplayName();
+ }
// Is Chrome Frame installed?
product_state =
@@ -721,21 +724,6 @@ bool InstallationValidator::ValidateInstallationTypeForState(
*type = static_cast<InstallationType>(*type | cf_bit);
}
- // Is Chrome App Host installed?
- product_state =
- machine_state.GetProductState(system_level,
- BrowserDistribution::CHROME_APP_HOST);
- if (product_state != NULL) {
- ChromeAppHostRules chrome_app_host_rules;
- ValidateProduct(machine_state, system_level, *product_state,
- chrome_app_host_rules, &rock_on);
- *type = static_cast<InstallationType>(*type | ProductBits::CHROME_APP_HOST);
- if (!product_state->is_multi_install()) {
- LOG(ERROR) << "Chrome App Launcher must always be multi-install.";
- rock_on = false;
- }
- }
-
DCHECK_NE(std::find(&kInstallationTypes[0],
&kInstallationTypes[arraysize(kInstallationTypes)],
*type),

Powered by Google App Engine
This is Rietveld 408576698