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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 LOG(ERROR) << "DeleteChromeFilesAndFolders: no installation destination " | 459 LOG(ERROR) << "DeleteChromeFilesAndFolders: no installation destination " |
460 << "path."; | 460 << "path."; |
461 return DELETE_FAILED; // Nothing else we can do to uninstall, so we return. | 461 return DELETE_FAILED; // Nothing else we can do to uninstall, so we return. |
462 } | 462 } |
463 | 463 |
464 DeleteInstallTempDir(target_path); | 464 DeleteInstallTempDir(target_path); |
465 | 465 |
466 DeleteResult result = DELETE_SUCCEEDED; | 466 DeleteResult result = DELETE_SUCCEEDED; |
467 | 467 |
468 using file_util::FileEnumerator; | 468 using file_util::FileEnumerator; |
469 FileEnumerator file_enumerator( | 469 FileEnumerator file_enumerator(target_path, false, |
470 target_path, | 470 FileEnumerator::FILES | FileEnumerator::DIRECTORIES); |
471 false, | |
472 static_cast<FileEnumerator::FileType>(FileEnumerator::FILES | | |
473 FileEnumerator::DIRECTORIES)); | |
474 while (true) { | 471 while (true) { |
475 FilePath to_delete(file_enumerator.Next()); | 472 FilePath to_delete(file_enumerator.Next()); |
476 if (to_delete.empty()) | 473 if (to_delete.empty()) |
477 break; | 474 break; |
478 if (to_delete.BaseName().value() == installer::kChromeAppHostExe) | 475 if (to_delete.BaseName().value() == installer::kChromeAppHostExe) |
479 continue; | 476 continue; |
480 | 477 |
481 VLOG(1) << "Deleting install path " << target_path.value(); | 478 VLOG(1) << "Deleting install path " << target_path.value(); |
482 if (!file_util::Delete(to_delete, true)) { | 479 if (!file_util::Delete(to_delete, true)) { |
483 LOG(ERROR) << "Failed to delete path (1st try): " << to_delete.value(); | 480 LOG(ERROR) << "Failed to delete path (1st try): " << to_delete.value(); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 | 1144 |
1148 // Try and delete the preserved local state once the post-install | 1145 // Try and delete the preserved local state once the post-install |
1149 // operations are complete. | 1146 // operations are complete. |
1150 if (!backup_state_file.empty()) | 1147 if (!backup_state_file.empty()) |
1151 file_util::Delete(backup_state_file, false); | 1148 file_util::Delete(backup_state_file, false); |
1152 | 1149 |
1153 return ret; | 1150 return ret; |
1154 } | 1151 } |
1155 | 1152 |
1156 } // namespace installer | 1153 } // namespace installer |
OLD | NEW |