Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/installer/util/installer_state.h" | 5 #include "chrome/installer/util/installer_state.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 VLOG(1) << (is_uninstall ? "Uninstall" : "Install") | 125 VLOG(1) << (is_uninstall ? "Uninstall" : "Install") |
| 126 << " distribution: " << p->distribution()->GetAppShortCutName(); | 126 << " distribution: " << p->distribution()->GetAppShortCutName(); |
| 127 } | 127 } |
| 128 if (prefs.install_chrome_frame()) { | 128 if (prefs.install_chrome_frame()) { |
| 129 Product* p = | 129 Product* p = |
| 130 AddProductFromPreferences(BrowserDistribution::CHROME_FRAME, prefs, | 130 AddProductFromPreferences(BrowserDistribution::CHROME_FRAME, prefs, |
| 131 machine_state); | 131 machine_state); |
| 132 VLOG(1) << (is_uninstall ? "Uninstall" : "Install") | 132 VLOG(1) << (is_uninstall ? "Uninstall" : "Install") |
| 133 << " distribution: " << p->distribution()->GetAppShortCutName(); | 133 << " distribution: " << p->distribution()->GetAppShortCutName(); |
| 134 } | 134 } |
| 135 if (prefs.install_chrome_app_host()) { | 135 |
| 136 // 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.
| |
| 137 // then also uninstall App Host. | |
| 138 bool also_uninstall_app_host = false; | |
| 139 if (is_uninstall && prefs.install_chrome()) { | |
| 140 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.
| |
| 141 const ProductState* app_host_state = machine_state.GetProductState( | |
| 142 system_level_app_host, BrowserDistribution::CHROME_APP_HOST); | |
| 143 also_uninstall_app_host = app_host_state && | |
| 144 !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
| |
| 145 .HasSwitch(switches::kChromeAppLauncher); | |
| 146 } | |
| 147 | |
| 148 if (prefs.install_chrome_app_host() || also_uninstall_app_host) { | |
| 149 if (!prefs.install_chrome_app_host()) { | |
| 150 VLOG(1) << "Uninstalling App Host along with Chrome."; | |
| 151 } | |
| 136 Product* p = | 152 Product* p = |
| 137 AddProductFromPreferences(BrowserDistribution::CHROME_APP_HOST, prefs, | 153 AddProductFromPreferences(BrowserDistribution::CHROME_APP_HOST, prefs, |
| 138 machine_state); | 154 machine_state); |
| 139 VLOG(1) << (is_uninstall ? "Uninstall" : "Install") | 155 VLOG(1) << (is_uninstall ? "Uninstall" : "Install") |
| 140 << " distribution: " << p->distribution()->GetAppShortCutName(); | 156 << " distribution: " << p->distribution()->GetAppShortCutName(); |
| 141 } | 157 } |
| 142 | 158 |
| 143 if (!is_uninstall && is_multi_install()) { | 159 if (!is_uninstall && is_multi_install()) { |
| 144 bool need_binaries = false; | 160 bool need_binaries = false; |
| 145 if (FindProduct(BrowserDistribution::CHROME_APP_HOST)) { | 161 if (FindProduct(BrowserDistribution::CHROME_APP_HOST)) { |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 763 if (is_multi_install()) { | 779 if (is_multi_install()) { |
| 764 InstallUtil::AddInstallerResultItems( | 780 InstallUtil::AddInstallerResultItems( |
| 765 system_install, multi_package_binaries_distribution()->GetStateKey(), | 781 system_install, multi_package_binaries_distribution()->GetStateKey(), |
| 766 status, string_resource_id, launch_cmd, install_list.get()); | 782 status, string_resource_id, launch_cmd, install_list.get()); |
| 767 } | 783 } |
| 768 if (!install_list->Do()) | 784 if (!install_list->Do()) |
| 769 LOG(ERROR) << "Failed to record installer error information in registry."; | 785 LOG(ERROR) << "Failed to record installer error information in registry."; |
| 770 } | 786 } |
| 771 | 787 |
| 772 } // namespace installer | 788 } // namespace installer |
| OLD | NEW |