Chromium Code Reviews| Index: chrome/installer/util/installer_state.cc |
| diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc |
| index b7ab42ba04e7635808035d563462fb39292e7a5c..34c38d6c927b711ff47e627a9f4e4693cbc2e5fa 100644 |
| --- a/chrome/installer/util/installer_state.cc |
| +++ b/chrome/installer/util/installer_state.cc |
| @@ -132,7 +132,23 @@ void InstallerState::Initialize(const CommandLine& command_line, |
| VLOG(1) << (is_uninstall ? "Uninstall" : "Install") |
| << " distribution: " << p->distribution()->GetAppShortCutName(); |
| } |
| - if (prefs.install_chrome_app_host()) { |
| + |
| + // If Chrome is being uninstalled, and (non-App Launcher) App Host exists, |
|
grt (UTC plus 2)
2012/11/16 04:25:17
suggest "Uninstall App Host if Chrome is being uni
grt (UTC plus 2)
2012/11/16 04:25:17
please consider if this logic belongs in the "if (
huangs
2012/11/16 16:48:57
Done. Added more comments regarding mix of system
huangs
2012/11/16 16:48:57
Done, but with slight code duplication.
|
| + // then also uninstall App Host. |
| + bool also_uninstall_app_host = false; |
| + if (is_uninstall && prefs.install_chrome()) { |
| + bool system_level_app_host = false; |
|
erikwright (departed)
2012/11/16 02:59:19
I don't see the merit of this boolean variable, no
huangs
2012/11/16 16:48:57
Done.
|
| + const ProductState* app_host_state = machine_state.GetProductState( |
| + system_level_app_host, BrowserDistribution::CHROME_APP_HOST); |
| + also_uninstall_app_host = app_host_state && |
| + !CommandLine(app_host_state->uninstall_command()) |
|
grt (UTC plus 2)
2012/11/16 04:25:17
!app_host_state->uninstall_command().HasSwitch(...
huangs
2012/11/16 16:48:57
Done. Also fixing same goof in install.cc
|
| + .HasSwitch(switches::kChromeAppLauncher); |
| + } |
| + |
| + if (prefs.install_chrome_app_host() || also_uninstall_app_host) { |
| + if (!prefs.install_chrome_app_host()) { |
| + VLOG(1) << "Uninstalling App Host along with Chrome."; |
| + } |
| Product* p = |
| AddProductFromPreferences(BrowserDistribution::CHROME_APP_HOST, prefs, |
| machine_state); |