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

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

Issue 10665002: Implement installation of the Chrome App Host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A basic working app host installer/uninstaller. Created 8 years, 5 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/installer_state.cc
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
index 24572be38f526e9795e1457b850ca6ee08f77cf2..a142924180c3a3d3fd4c5d6bdeb791f920a425e6 100644
--- a/chrome/installer/util/installer_state.cc
+++ b/chrome/installer/util/installer_state.cc
@@ -126,6 +126,49 @@ void InstallerState::Initialize(const CommandLine& command_line,
VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
<< " distribution: " << p->distribution()->GetAppShortCutName();
}
+ if (prefs.install_chrome_app_host()) {
+ Product* p =
+ AddProductFromPreferences(BrowserDistribution::CHROME_APP_HOST, prefs,
+ machine_state);
+ VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
+ << " distribution: " << p->distribution()->GetAppShortCutName();
+ }
+
+ if (is_uninstall && prefs.is_multi_install()) {
+ bool keep_binaries = false;
+ // Look for a product that is not the binaries and that is not being
+ // uninstalled. If not found, binaries are uninstalled too.
+ for (size_t i = 0; i < BrowserDistribution::kNumProductTypes; ++i) {
+ if (BrowserDistribution::kProductTypes[i] ==
+ BrowserDistribution::CHROME_BINARIES) {
+ continue;
+ }
+
+ if (machine_state.GetProductState(
+ system_install(),
+ BrowserDistribution::kProductTypes[i]) == NULL) {
+ // The product is not installed.
+ continue;
+ }
+
+ // The product is installed.
+
+ if (!FindProduct(BrowserDistribution::kProductTypes[i])) {
+ // The product is not being uninstalled.
+ keep_binaries = true;
+ break;
+ }
+
+ // The product is being uninstalled.
+ }
+ if (!keep_binaries) {
+ Product* p =
+ AddProductFromPreferences(BrowserDistribution::CHROME_BINARIES, prefs,
+ machine_state);
+ VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
+ << " distribution: " << p->distribution()->GetAppShortCutName();
+ }
+ }
BrowserDistribution* operand = NULL;
@@ -148,10 +191,19 @@ void InstallerState::Initialize(const CommandLine& command_line,
}
if (operand == NULL) {
+ BrowserDistribution::Type operand_distribution_type =
+ BrowserDistribution::CHROME_BINARIES;
+ if (prefs.install_chrome())
+ operand_distribution_type = BrowserDistribution::CHROME_BROWSER;
+ else if (prefs.install_chrome_frame())
+ operand_distribution_type = BrowserDistribution::CHROME_FRAME;
+ else if (prefs.install_chrome_app_host())
+ operand_distribution_type = BrowserDistribution::CHROME_APP_HOST;
+ else
+ NOTREACHED();
+
operand = BrowserDistribution::GetSpecificDistribution(
- prefs.install_chrome() ?
- BrowserDistribution::CHROME_BROWSER :
- BrowserDistribution::CHROME_FRAME);
+ operand_distribution_type);
}
state_key_ = operand->GetStateKey();

Powered by Google App Engine
This is Rietveld 408576698