| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const installer::InstallationState& machine_state) { | 112 const installer::InstallationState& machine_state) { |
| 113 scoped_ptr<WorkItemList> work_item_list( | 113 scoped_ptr<WorkItemList> work_item_list( |
| 114 WorkItem::CreateNoRollbackWorkItemList()); | 114 WorkItem::CreateNoRollbackWorkItemList()); |
| 115 | 115 |
| 116 AddQuickEnableWorkItems(installer_state, machine_state, NULL, NULL, | 116 AddQuickEnableWorkItems(installer_state, machine_state, NULL, NULL, |
| 117 work_item_list.get()); | 117 work_item_list.get()); |
| 118 if (!work_item_list->Do()) | 118 if (!work_item_list->Do()) |
| 119 LOG(ERROR) << "Failed to update quick-enable-cf command."; | 119 LOG(ERROR) << "Failed to update quick-enable-cf command."; |
| 120 } | 120 } |
| 121 | 121 |
| 122 void ProcessIELowRightsPolicyWorkItems( |
| 123 const installer::InstallerState& installer_state) { |
| 124 scoped_ptr<WorkItemList> work_items(WorkItem::CreateNoRollbackWorkItemList()); |
| 125 MaybeAddDeleteOldIELowRightsPolicyWorkItems(installer_state, |
| 126 work_items.get()); |
| 127 work_items->Do(); |
| 128 installer::RefreshElevationPolicy(); |
| 129 } |
| 130 |
| 122 void ClearRlzProductState() { | 131 void ClearRlzProductState() { |
| 123 const rlz_lib::AccessPoint points[] = {rlz_lib::CHROME_OMNIBOX, | 132 const rlz_lib::AccessPoint points[] = {rlz_lib::CHROME_OMNIBOX, |
| 124 rlz_lib::CHROME_HOME_PAGE, | 133 rlz_lib::CHROME_HOME_PAGE, |
| 125 rlz_lib::NO_ACCESS_POINT}; | 134 rlz_lib::NO_ACCESS_POINT}; |
| 126 | 135 |
| 127 rlz_lib::ClearProductState(rlz_lib::CHROME, points); | 136 rlz_lib::ClearProductState(rlz_lib::CHROME, points); |
| 128 | 137 |
| 129 // If chrome has been reactivated, clear all events for this brand as well. | 138 // If chrome has been reactivated, clear all events for this brand as well. |
| 130 std::wstring reactivation_brand; | 139 std::wstring reactivation_brand; |
| 131 if (GoogleUpdateSettings::GetReactivationBrand(&reactivation_brand)) { | 140 if (GoogleUpdateSettings::GetReactivationBrand(&reactivation_brand)) { |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 WorkItem::CreateWorkItemList()); | 792 WorkItem::CreateWorkItemList()); |
| 784 | 793 |
| 785 AddRegisterComDllWorkItems(dll_folder, | 794 AddRegisterComDllWorkItems(dll_folder, |
| 786 com_dll_list, | 795 com_dll_list, |
| 787 installer_state.system_install(), | 796 installer_state.system_install(), |
| 788 false, // Unregister | 797 false, // Unregister |
| 789 true, // May fail | 798 true, // May fail |
| 790 unreg_work_item_list.get()); | 799 unreg_work_item_list.get()); |
| 791 unreg_work_item_list->Do(); | 800 unreg_work_item_list->Do(); |
| 792 } | 801 } |
| 802 |
| 803 ProcessIELowRightsPolicyWorkItems(installer_state); |
| 793 } | 804 } |
| 794 | 805 |
| 795 // Close any Chrome Frame helper processes that may be running. | 806 // Close any Chrome Frame helper processes that may be running. |
| 796 if (product.is_chrome_frame()) { | 807 if (product.is_chrome_frame()) { |
| 797 VLOG(1) << "Closing the Chrome Frame helper process"; | 808 VLOG(1) << "Closing the Chrome Frame helper process"; |
| 798 CloseChromeFrameHelperProcess(); | 809 CloseChromeFrameHelperProcess(); |
| 799 } | 810 } |
| 800 | 811 |
| 801 if (product_state == NULL) | 812 if (product_state == NULL) |
| 802 return installer::UNINSTALL_SUCCESSFUL; | 813 return installer::UNINSTALL_SUCCESSFUL; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 818 if (prod_state.Initialize(installer_state.system_install(), | 829 if (prod_state.Initialize(installer_state.system_install(), |
| 819 BrowserDistribution::kProductTypes[i]) && | 830 BrowserDistribution::kProductTypes[i]) && |
| 820 prod_state.is_multi_install()) { | 831 prod_state.is_multi_install()) { |
| 821 can_delete_files = false; | 832 can_delete_files = false; |
| 822 break; | 833 break; |
| 823 } | 834 } |
| 824 } | 835 } |
| 825 LOG(INFO) << (can_delete_files ? "Shared binaries will be deleted." : | 836 LOG(INFO) << (can_delete_files ? "Shared binaries will be deleted." : |
| 826 "Shared binaries still in use."); | 837 "Shared binaries still in use."); |
| 827 if (can_delete_files) { | 838 if (can_delete_files) { |
| 828 // Remove the elevation policy when the last product is uninstalled. | |
| 829 scoped_ptr<WorkItemList> work_items( | |
| 830 WorkItem::CreateNoRollbackWorkItemList()); | |
| 831 AddElevationPolicyWorkItems(original_state, installer_state, | |
| 832 product_state->version(), work_items.get()); | |
| 833 work_items->Do(); | |
| 834 RefreshElevationPolicy(); | |
| 835 | |
| 836 BrowserDistribution* multi_dist = | 839 BrowserDistribution* multi_dist = |
| 837 installer_state.multi_package_binaries_distribution(); | 840 installer_state.multi_package_binaries_distribution(); |
| 838 InstallUtil::DeleteRegistryKey(reg_root, multi_dist->GetVersionKey()); | 841 InstallUtil::DeleteRegistryKey(reg_root, multi_dist->GetVersionKey()); |
| 839 } | 842 } |
| 840 } | 843 } |
| 841 | 844 |
| 842 FilePath backup_state_file(BackupLocalStateFile( | 845 FilePath backup_state_file(BackupLocalStateFile( |
| 843 GetLocalStateFolder(product))); | 846 GetLocalStateFolder(product))); |
| 844 | 847 |
| 845 DeleteResult delete_result = DELETE_SUCCEEDED; | 848 DeleteResult delete_result = DELETE_SUCCEEDED; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 870 | 873 |
| 871 // Try and delete the preserved local state once the post-install | 874 // Try and delete the preserved local state once the post-install |
| 872 // operations are complete. | 875 // operations are complete. |
| 873 if (!backup_state_file.empty()) | 876 if (!backup_state_file.empty()) |
| 874 file_util::Delete(backup_state_file, false); | 877 file_util::Delete(backup_state_file, false); |
| 875 | 878 |
| 876 return ret; | 879 return ret; |
| 877 } | 880 } |
| 878 | 881 |
| 879 } // namespace installer | 882 } // namespace installer |
| OLD | NEW |