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 // This file defines the methods useful for uninstalling Chrome. | 5 // This file defines the methods useful for uninstalling Chrome. |
6 | 6 |
7 #include "chrome/installer/setup/uninstall.h" | 7 #include "chrome/installer/setup/uninstall.h" |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 LOG(WARNING) << "Failed to delete Quick Launch shortcut."; | 300 LOG(WARNING) << "Failed to delete Quick Launch shortcut."; |
301 } | 301 } |
302 | 302 |
303 VLOG(1) << "Deleting Start Menu shortcuts."; | 303 VLOG(1) << "Deleting Start Menu shortcuts."; |
304 if (!ShellUtil::RemoveChromeShortcut( | 304 if (!ShellUtil::RemoveChromeShortcut( |
305 ShellUtil::SHORTCUT_START_MENU, dist, chrome_exe, install_level, | 305 ShellUtil::SHORTCUT_START_MENU, dist, chrome_exe, install_level, |
306 NULL)) { | 306 NULL)) { |
307 LOG(WARNING) << "Failed to delete Start Menu shortcuts."; | 307 LOG(WARNING) << "Failed to delete Start Menu shortcuts."; |
308 } | 308 } |
309 | 309 |
| 310 // Although the shortcut removal calls above will unpin their shortcut if they |
| 311 // result in a deletion (i.e. shortcut existed and pointed to |chrome_exe|), |
| 312 // it is possible for shortcuts to remain pinned while their parent shortcut |
| 313 // has been deleted or changed to point to another |chrome_exe|. Make sure all |
| 314 // pinned-to-taskbar shortcuts that point to |chrome_exe| are unpinned. |
| 315 ShellUtil::RemoveChromeTaskbarShortcuts(chrome_exe); |
| 316 |
310 ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(), | 317 ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(), |
311 chrome_exe); | 318 chrome_exe); |
312 } | 319 } |
313 | 320 |
314 bool ScheduleParentAndGrandparentForDeletion(const FilePath& path) { | 321 bool ScheduleParentAndGrandparentForDeletion(const FilePath& path) { |
315 FilePath parent_dir = path.DirName(); | 322 FilePath parent_dir = path.DirName(); |
316 bool ret = ScheduleFileSystemEntityForDeletion(parent_dir.value().c_str()); | 323 bool ret = ScheduleFileSystemEntityForDeletion(parent_dir.value().c_str()); |
317 if (!ret) { | 324 if (!ret) { |
318 LOG(ERROR) << "Failed to schedule parent dir for deletion: " | 325 LOG(ERROR) << "Failed to schedule parent dir for deletion: " |
319 << parent_dir.value(); | 326 << parent_dir.value(); |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 | 1272 |
1266 // Try and delete the preserved local state once the post-install | 1273 // Try and delete the preserved local state once the post-install |
1267 // operations are complete. | 1274 // operations are complete. |
1268 if (!backup_state_file.empty()) | 1275 if (!backup_state_file.empty()) |
1269 file_util::Delete(backup_state_file, false); | 1276 file_util::Delete(backup_state_file, false); |
1270 | 1277 |
1271 return ret; | 1278 return ret; |
1272 } | 1279 } |
1273 | 1280 |
1274 } // namespace installer | 1281 } // namespace installer |
OLD | NEW |