| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 InstallUtil::DeleteRegistryKey(roots[i], ext_prog_id); | 682 InstallUtil::DeleteRegistryKey(roots[i], ext_prog_id); |
| 683 | 683 |
| 684 // Delete Software\Classes\.crx, | 684 // Delete Software\Classes\.crx, |
| 685 std::wstring ext_association(ShellUtil::kRegClasses); | 685 std::wstring ext_association(ShellUtil::kRegClasses); |
| 686 ext_association.append(L"\\"); | 686 ext_association.append(L"\\"); |
| 687 ext_association.append(chrome::kExtensionFileExtension); | 687 ext_association.append(chrome::kExtensionFileExtension); |
| 688 InstallUtil::DeleteRegistryKey(roots[i], ext_association); | 688 InstallUtil::DeleteRegistryKey(roots[i], ext_association); |
| 689 } | 689 } |
| 690 } | 690 } |
| 691 | 691 |
| 692 bool ProcessChromeWorkItems(const InstallationState& original_state, | 692 // Builds and executes a work item list to remove DelegateExecute verb handler |
| 693 const InstallerState& installer_state, | 693 // work items for |product|. This will be a noop for products whose |
| 694 const FilePath& setup_path, | 694 // corresponding BrowserDistribution implementations do not publish |
| 695 const Product& product) { | 695 // DelegateExecute data via an implementation of GetDelegateExecuteHandlerData. |
| 696 if (product.is_chrome()) | 696 bool ProcessDelegateExecuteWorkItems(const InstallationState& original_state, |
| 697 return false; | 697 const InstallerState& installer_state, |
| 698 | 698 const FilePath& setup_path, |
| 699 scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); | 699 const Product& product) { |
| 700 AddChromeWorkItems(original_state, installer_state, setup_path, Version(), | 700 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); |
| 701 product, item_list.get()); | 701 AddDelegateExecuteWorkItems(original_state, installer_state, setup_path, |
| 702 Version(), product, item_list.get()); |
| 702 return item_list->Do(); | 703 return item_list->Do(); |
| 703 } | 704 } |
| 704 | 705 |
| 705 bool ProcessChromeFrameWorkItems(const InstallationState& original_state, | 706 bool ProcessChromeFrameWorkItems(const InstallationState& original_state, |
| 706 const InstallerState& installer_state, | 707 const InstallerState& installer_state, |
| 707 const FilePath& setup_path, | 708 const FilePath& setup_path, |
| 708 const Product& product) { | 709 const Product& product) { |
| 709 if (!product.is_chrome_frame()) | 710 if (!product.is_chrome_frame()) |
| 710 return false; | 711 return false; |
| 711 | 712 |
| 712 scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); | 713 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); |
| 713 AddChromeFrameWorkItems(original_state, installer_state, setup_path, | 714 AddChromeFrameWorkItems(original_state, installer_state, setup_path, |
| 714 Version(), product, item_list.get()); | 715 Version(), product, item_list.get()); |
| 715 return item_list->Do(); | 716 return item_list->Do(); |
| 716 } | 717 } |
| 717 | 718 |
| 718 InstallStatus UninstallProduct(const InstallationState& original_state, | 719 InstallStatus UninstallProduct(const InstallationState& original_state, |
| 719 const InstallerState& installer_state, | 720 const InstallerState& installer_state, |
| 720 const FilePath& setup_path, | 721 const FilePath& setup_path, |
| 721 const Product& product, | 722 const Product& product, |
| 722 bool remove_all, | 723 bool remove_all, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 suffix, installer_state.target_path(), &ret); | 813 suffix, installer_state.target_path(), &ret); |
| 813 | 814 |
| 814 // Registration data is put in HKLM for system level and possibly user level | 815 // Registration data is put in HKLM for system level and possibly user level |
| 815 // installs (when Chrome is made the default browser at install-time). | 816 // installs (when Chrome is made the default browser at install-time). |
| 816 if (installer_state.system_install() || remove_all && | 817 if (installer_state.system_install() || remove_all && |
| 817 (!suffix.empty() || CurrentUserHasDefaultBrowser(installer_state))) { | 818 (!suffix.empty() || CurrentUserHasDefaultBrowser(installer_state))) { |
| 818 DeleteChromeRegistrationKeys(product.distribution(), HKEY_LOCAL_MACHINE, | 819 DeleteChromeRegistrationKeys(product.distribution(), HKEY_LOCAL_MACHINE, |
| 819 suffix, installer_state.target_path(), &ret); | 820 suffix, installer_state.target_path(), &ret); |
| 820 } | 821 } |
| 821 | 822 |
| 822 if (is_chrome) { | 823 ProcessDelegateExecuteWorkItems(original_state, installer_state, setup_path, |
| 823 ProcessChromeWorkItems(original_state, installer_state, setup_path, | 824 product); |
| 824 product); | 825 |
| 825 } else { | 826 if (!is_chrome) { |
| 826 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, | 827 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, |
| 827 product); | 828 product); |
| 828 } | 829 } |
| 829 | 830 |
| 830 if (installer_state.is_multi_install()) | 831 if (installer_state.is_multi_install()) |
| 831 ProcessGoogleUpdateItems(original_state, installer_state, product); | 832 ProcessGoogleUpdateItems(original_state, installer_state, product); |
| 832 | 833 |
| 833 ProcessQuickEnableWorkItems(installer_state, original_state); | 834 ProcessQuickEnableWorkItems(installer_state, original_state); |
| 834 | 835 |
| 835 // Get the state of the installed product (if any) | 836 // Get the state of the installed product (if any) |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 | 945 |
| 945 // Try and delete the preserved local state once the post-install | 946 // Try and delete the preserved local state once the post-install |
| 946 // operations are complete. | 947 // operations are complete. |
| 947 if (!backup_state_file.empty()) | 948 if (!backup_state_file.empty()) |
| 948 file_util::Delete(backup_state_file, false); | 949 file_util::Delete(backup_state_file, false); |
| 949 | 950 |
| 950 return ret; | 951 return ret; |
| 951 } | 952 } |
| 952 | 953 |
| 953 } // namespace installer | 954 } // namespace installer |
| OLD | NEW |