Index: chrome/installer/setup/uninstall.cc |
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc |
index 5c694b41c464a71751437d5e16ff9793970f0c66..e95ff8352152e0f02e6356506b773449f0ba81ff 100644 |
--- a/chrome/installer/setup/uninstall.cc |
+++ b/chrome/installer/setup/uninstall.cc |
@@ -256,29 +256,13 @@ void CloseChromeFrameHelperProcess() { |
} |
} |
-// This method deletes Chrome shortcut folder from Windows Start menu. It |
-// checks system_uninstall to see if the shortcut is in all users start menu |
-// or current user start menu. |
-// We try to remove the standard desktop shortcut but if that fails we try |
-// to remove the alternate desktop shortcut. Only one of them should be |
-// present in a given install but at this point we don't know which one. |
-// We remove all start screen secondary tiles by removing the folder Windows |
-// uses to store this installation's tiles. |
-void DeleteChromeShortcuts(const InstallerState& installer_state, |
- const Product& product, |
+// This method deletes shortcut from Windows Start menu, for the given |
+// |install_level|. Either the standard desktop shortcut or the alternate |
+// desktop shortcut are present. We don't know which one is present, so we |
+// delete both. Finally, we delete the quick lauch shortcut. |
+void DeleteShortcutsCommon(ShellUtil::ShellChange install_level, |
+ BrowserDistribution* dist, |
const string16& chrome_exe) { |
- if (!product.is_chrome()) { |
- VLOG(1) << __FUNCTION__ " called for non-CHROME distribution"; |
- return; |
- } |
- |
- BrowserDistribution* dist = product.distribution(); |
- |
- // The per-user shortcut for this user, if present on a system-level install, |
- // has already been deleted in chrome_browser_main_win.cc::DoUninstallTasks(). |
- ShellUtil::ShellChange install_level = installer_state.system_install() ? |
- ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; |
- |
VLOG(1) << "Deleting Desktop shortcut."; |
if (!ShellUtil::RemoveChromeShortcut( |
ShellUtil::SHORTCUT_DESKTOP, dist, chrome_exe, install_level, NULL)) { |
@@ -299,6 +283,45 @@ void DeleteChromeShortcuts(const InstallerState& installer_state, |
NULL)) { |
LOG(WARNING) << "Failed to delete Quick Launch shortcut."; |
} |
+} |
+ |
+// This method deletes App Host shortcuts. |
+void DeleteAppHostShortcuts(const InstallerState& installer_state, |
+ const Product& product, |
+ const string16& chrome_exe) { |
+ if (!product.is_chrome_app_host()) { |
+ VLOG(1) << __FUNCTION__ " called for non-APP HOST distribution"; |
+ return; |
+ } |
+ |
+ // The per-user shortcut for this user, if present on a system-level install, |
+ // has already been deleted in chrome_browser_main_win.cc::DoUninstallTasks(). |
+ ShellUtil::ShellChange install_level = installer_state.system_install() ? |
+ ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; |
+ |
+ DeleteShortcutsCommon(install_level, product.distribution(), chrome_exe); |
+} |
+ |
+// This method deletes Chrome shortcut folder from Windows Start menu. It |
+// checks system_uninstall to see if the shortcut is in all users start menu |
+// or current user start menu. After deleting individual shortcuts, we then |
+// remove all start screen secondary tiles by removing the folder Windows |
+// uses to store this installation's tiles. |
+void DeleteChromeShortcuts(const InstallerState& installer_state, |
+ const Product& product, |
+ const string16& chrome_exe) { |
+ if (!product.is_chrome()) { |
+ VLOG(1) << __FUNCTION__ " called for non-CHROME distribution"; |
+ return; |
+ } |
+ |
+ // The per-user shortcut for this user, if present on a system-level install, |
+ // has already been deleted in chrome_browser_main_win.cc::DoUninstallTasks(). |
+ ShellUtil::ShellChange install_level = installer_state.system_install() ? |
+ ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; |
+ |
+ BrowserDistribution* dist = product.distribution(); |
+ DeleteShortcutsCommon(install_level, dist, chrome_exe); |
VLOG(1) << "Deleting Start Menu shortcuts."; |
if (!ShellUtil::RemoveChromeShortcut( |
@@ -1008,6 +1031,7 @@ InstallStatus UninstallProduct(const InstallationState& original_state, |
chrome_exe)); |
bool is_chrome = product.is_chrome(); |
+ bool is_app_host = product.is_chrome_app_host(); |
VLOG(1) << "UninstallProduct: " << browser_dist->GetAppShortCutName(); |
@@ -1055,6 +1079,11 @@ InstallStatus UninstallProduct(const InstallationState& original_state, |
// Chrome is not in use so lets uninstall Chrome by deleting various files |
// and registry entries. Here we will just make best effort and keep going |
// in case of errors. |
+ if (is_app_host) { |
+ // First delete shortcuts from Start->Programs, Desktop & Quick Launch. |
+ DeleteAppHostShortcuts(installer_state, product, chrome_exe); |
+ } |
+ |
if (is_chrome) { |
ClearRlzProductState(); |
// Delete the key that delegate_execute might make. |