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 bool ProcessDelegateExecuteWorkItems(const InstallationState& original_state, |
693 const InstallerState& installer_state, | 693 const InstallerState& installer_state, |
694 const FilePath& setup_path, | 694 const FilePath& setup_path, |
695 const Product& product) { | 695 const Product& product) { |
696 if (product.is_chrome()) | 696 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); |
697 return false; | 697 AddDelegateExecuteWorkItems(original_state, installer_state, setup_path, |
698 | 698 Version(), product, item_list.get()); |
699 scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); | |
700 AddChromeWorkItems(original_state, installer_state, setup_path, Version(), | |
701 product, item_list.get()); | |
702 return item_list->Do(); | 699 return item_list->Do(); |
703 } | 700 } |
704 | 701 |
705 bool ProcessChromeFrameWorkItems(const InstallationState& original_state, | 702 bool ProcessChromeFrameWorkItems(const InstallationState& original_state, |
706 const InstallerState& installer_state, | 703 const InstallerState& installer_state, |
707 const FilePath& setup_path, | 704 const FilePath& setup_path, |
708 const Product& product) { | 705 const Product& product) { |
709 if (!product.is_chrome_frame()) | 706 if (!product.is_chrome_frame()) |
710 return false; | 707 return false; |
711 | 708 |
712 scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); | 709 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); |
713 AddChromeFrameWorkItems(original_state, installer_state, setup_path, | 710 AddChromeFrameWorkItems(original_state, installer_state, setup_path, |
714 Version(), product, item_list.get()); | 711 Version(), product, item_list.get()); |
715 return item_list->Do(); | 712 return item_list->Do(); |
716 } | 713 } |
717 | 714 |
718 InstallStatus UninstallProduct(const InstallationState& original_state, | 715 InstallStatus UninstallProduct(const InstallationState& original_state, |
719 const InstallerState& installer_state, | 716 const InstallerState& installer_state, |
720 const FilePath& setup_path, | 717 const FilePath& setup_path, |
721 const Product& product, | 718 const Product& product, |
722 bool remove_all, | 719 bool remove_all, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
812 suffix, installer_state.target_path(), &ret); | 809 suffix, installer_state.target_path(), &ret); |
813 | 810 |
814 // Registration data is put in HKLM for system level and possibly user level | 811 // 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). | 812 // installs (when Chrome is made the default browser at install-time). |
816 if (installer_state.system_install() || remove_all && | 813 if (installer_state.system_install() || remove_all && |
817 (!suffix.empty() || CurrentUserHasDefaultBrowser(installer_state))) { | 814 (!suffix.empty() || CurrentUserHasDefaultBrowser(installer_state))) { |
818 DeleteChromeRegistrationKeys(product.distribution(), HKEY_LOCAL_MACHINE, | 815 DeleteChromeRegistrationKeys(product.distribution(), HKEY_LOCAL_MACHINE, |
819 suffix, installer_state.target_path(), &ret); | 816 suffix, installer_state.target_path(), &ret); |
820 } | 817 } |
821 | 818 |
822 if (is_chrome) { | 819 ProcessDelegateExecuteWorkItems(original_state, installer_state, setup_path, |
robertshield
2012/04/17 14:51:19
perhaps a clarifying comment here on near the impl
grt (UTC plus 2)
2012/04/17 15:27:33
Done.
| |
823 ProcessChromeWorkItems(original_state, installer_state, setup_path, | 820 product); |
824 product); | 821 |
825 } else { | 822 if (!is_chrome) { |
826 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, | 823 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, |
827 product); | 824 product); |
828 } | 825 } |
829 | 826 |
830 if (installer_state.is_multi_install()) | 827 if (installer_state.is_multi_install()) |
831 ProcessGoogleUpdateItems(original_state, installer_state, product); | 828 ProcessGoogleUpdateItems(original_state, installer_state, product); |
832 | 829 |
833 ProcessQuickEnableWorkItems(installer_state, original_state); | 830 ProcessQuickEnableWorkItems(installer_state, original_state); |
834 | 831 |
835 // Get the state of the installed product (if any) | 832 // Get the state of the installed product (if any) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
944 | 941 |
945 // Try and delete the preserved local state once the post-install | 942 // Try and delete the preserved local state once the post-install |
946 // operations are complete. | 943 // operations are complete. |
947 if (!backup_state_file.empty()) | 944 if (!backup_state_file.empty()) |
948 file_util::Delete(backup_state_file, false); | 945 file_util::Delete(backup_state_file, false); |
949 | 946 |
950 return ret; | 947 return ret; |
951 } | 948 } |
952 | 949 |
953 } // namespace installer | 950 } // namespace installer |
OLD | NEW |