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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 // Copy the first local state file that is found. | 425 // Copy the first local state file that is found. |
426 for (size_t i = 0; i < local_state_folders.size(); ++i) { | 426 for (size_t i = 0; i < local_state_folders.size(); ++i) { |
427 const base::FilePath& local_state_folder = local_state_folders[i]; | 427 const base::FilePath& local_state_folder = local_state_folders[i]; |
428 base::FilePath state_file( | 428 base::FilePath state_file( |
429 local_state_folder.Append(chrome::kLocalStateFilename)); | 429 local_state_folder.Append(chrome::kLocalStateFilename)); |
430 if (!file_util::PathExists(state_file)) | 430 if (!file_util::PathExists(state_file)) |
431 continue; | 431 continue; |
432 if (!file_util::CreateTemporaryFile(&backup)) | 432 if (!file_util::CreateTemporaryFile(&backup)) |
433 LOG(ERROR) << "Failed to create temporary file for Local State."; | 433 LOG(ERROR) << "Failed to create temporary file for Local State."; |
434 else | 434 else |
435 file_util::CopyFile(state_file, backup); | 435 base::CopyFile(state_file, backup); |
436 break; | 436 break; |
437 } | 437 } |
438 return backup; | 438 return backup; |
439 } | 439 } |
440 | 440 |
441 // Deletes all user data directories for a product. | 441 // Deletes all user data directories for a product. |
442 DeleteResult DeleteLocalState( | 442 DeleteResult DeleteLocalState( |
443 const std::vector<base::FilePath>& local_state_folders, | 443 const std::vector<base::FilePath>& local_state_folders, |
444 bool schedule_on_failure) { | 444 bool schedule_on_failure) { |
445 if (local_state_folders.empty()) | 445 if (local_state_folders.empty()) |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 // deletion unconditionally. If they are not empty, the session manager | 1426 // deletion unconditionally. If they are not empty, the session manager |
1427 // will not delete them on reboot. | 1427 // will not delete them on reboot. |
1428 ScheduleParentAndGrandparentForDeletion(target_path); | 1428 ScheduleParentAndGrandparentForDeletion(target_path); |
1429 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == | 1429 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == |
1430 installer::DELETE_FAILED) { | 1430 installer::DELETE_FAILED) { |
1431 *uninstall_status = installer::UNINSTALL_FAILED; | 1431 *uninstall_status = installer::UNINSTALL_FAILED; |
1432 } | 1432 } |
1433 } | 1433 } |
1434 | 1434 |
1435 } // namespace installer | 1435 } // namespace installer |
OLD | NEW |