| 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 // Delete each filetype association if it references this Chrome. Take care | 697 // Delete each filetype association if it references this Chrome. Take care |
| 698 // not to delete the association if it references a system-level install of | 698 // not to delete the association if it references a system-level install of |
| 699 // Chrome (only a risk if the suffix is empty). Don't delete the whole key | 699 // Chrome (only a risk if the suffix is empty). Don't delete the whole key |
| 700 // since other apps may have stored data there. | 700 // since other apps may have stored data there. |
| 701 std::vector<const wchar_t*> cleared_assocs; | 701 std::vector<const wchar_t*> cleared_assocs; |
| 702 if (installer_state.system_install() || | 702 if (installer_state.system_install() || |
| 703 !browser_entry_suffix.empty() || | 703 !browser_entry_suffix.empty() || |
| 704 !base::win::RegKey(HKEY_LOCAL_MACHINE, (classes_path + prog_id).c_str(), | 704 !base::win::RegKey(HKEY_LOCAL_MACHINE, (classes_path + prog_id).c_str(), |
| 705 KEY_QUERY_VALUE).Valid()) { | 705 KEY_QUERY_VALUE).Valid()) { |
| 706 InstallUtil::ValueEquals prog_id_pred(prog_id); | 706 InstallUtil::ValueEquals prog_id_pred(prog_id); |
| 707 for (const wchar_t* const* filetype = &ShellUtil::kFileAssociations[0]; | 707 for (const wchar_t* const* filetype = |
| 708 *filetype != NULL; ++filetype) { | 708 &ShellUtil::kPotentialFileAssociations[0]; *filetype != NULL; |
| 709 ++filetype) { |
| 709 if (InstallUtil::DeleteRegistryValueIf( | 710 if (InstallUtil::DeleteRegistryValueIf( |
| 710 root, (classes_path + *filetype).c_str(), NULL, | 711 root, (classes_path + *filetype).c_str(), NULL, |
| 711 prog_id_pred) == InstallUtil::DELETED) { | 712 prog_id_pred) == InstallUtil::DELETED) { |
| 712 cleared_assocs.push_back(*filetype); | 713 cleared_assocs.push_back(*filetype); |
| 713 } | 714 } |
| 714 } | 715 } |
| 715 } | 716 } |
| 716 | 717 |
| 717 // For all filetype associations in HKLM that have just been removed, attempt | 718 // For all filetype associations in HKLM that have just been removed, attempt |
| 718 // to restore some reasonable value. We have no definitive way of knowing | 719 // to restore some reasonable value. We have no definitive way of knowing |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 string16 app_path_key(ShellUtil::kAppPathsRegistryKey); | 830 string16 app_path_key(ShellUtil::kAppPathsRegistryKey); |
| 830 app_path_key.push_back(base::FilePath::kSeparators[0]); | 831 app_path_key.push_back(base::FilePath::kSeparators[0]); |
| 831 app_path_key.append(installer::kChromeExe); | 832 app_path_key.append(installer::kChromeExe); |
| 832 InstallUtil::DeleteRegistryKey(root, app_path_key); | 833 InstallUtil::DeleteRegistryKey(root, app_path_key); |
| 833 | 834 |
| 834 // Cleanup OpenWithList and OpenWithProgids: | 835 // Cleanup OpenWithList and OpenWithProgids: |
| 835 // http://msdn.microsoft.com/en-us/library/bb166549 | 836 // http://msdn.microsoft.com/en-us/library/bb166549 |
| 836 string16 file_assoc_key; | 837 string16 file_assoc_key; |
| 837 string16 open_with_list_key; | 838 string16 open_with_list_key; |
| 838 string16 open_with_progids_key; | 839 string16 open_with_progids_key; |
| 839 for (int i = 0; ShellUtil::kFileAssociations[i] != NULL; ++i) { | 840 for (int i = 0; ShellUtil::kPotentialFileAssociations[i] != NULL; ++i) { |
| 840 file_assoc_key.assign(ShellUtil::kRegClasses); | 841 file_assoc_key.assign(ShellUtil::kRegClasses); |
| 841 file_assoc_key.push_back(base::FilePath::kSeparators[0]); | 842 file_assoc_key.push_back(base::FilePath::kSeparators[0]); |
| 842 file_assoc_key.append(ShellUtil::kFileAssociations[i]); | 843 file_assoc_key.append(ShellUtil::kPotentialFileAssociations[i]); |
| 843 file_assoc_key.push_back(base::FilePath::kSeparators[0]); | 844 file_assoc_key.push_back(base::FilePath::kSeparators[0]); |
| 844 | 845 |
| 845 open_with_list_key.assign(file_assoc_key); | 846 open_with_list_key.assign(file_assoc_key); |
| 846 open_with_list_key.append(L"OpenWithList"); | 847 open_with_list_key.append(L"OpenWithList"); |
| 847 open_with_list_key.push_back(base::FilePath::kSeparators[0]); | 848 open_with_list_key.push_back(base::FilePath::kSeparators[0]); |
| 848 open_with_list_key.append(installer::kChromeExe); | 849 open_with_list_key.append(installer::kChromeExe); |
| 849 InstallUtil::DeleteRegistryKey(root, open_with_list_key); | 850 InstallUtil::DeleteRegistryKey(root, open_with_list_key); |
| 850 | 851 |
| 851 open_with_progids_key.assign(file_assoc_key); | 852 open_with_progids_key.assign(file_assoc_key); |
| 852 open_with_progids_key.append(ShellUtil::kRegOpenWithProgids); | 853 open_with_progids_key.append(ShellUtil::kRegOpenWithProgids); |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1414 // deletion unconditionally. If they are not empty, the session manager | 1415 // deletion unconditionally. If they are not empty, the session manager |
| 1415 // will not delete them on reboot. | 1416 // will not delete them on reboot. |
| 1416 ScheduleParentAndGrandparentForDeletion(target_path); | 1417 ScheduleParentAndGrandparentForDeletion(target_path); |
| 1417 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == | 1418 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == |
| 1418 installer::DELETE_FAILED) { | 1419 installer::DELETE_FAILED) { |
| 1419 *uninstall_status = installer::UNINSTALL_FAILED; | 1420 *uninstall_status = installer::UNINSTALL_FAILED; |
| 1420 } | 1421 } |
| 1421 } | 1422 } |
| 1422 | 1423 |
| 1423 } // namespace installer | 1424 } // namespace installer |
| OLD | NEW |