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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 &ShellUtil::kPotentialProtocolAssociations[0]; | 616 &ShellUtil::kPotentialProtocolAssociations[0]; |
617 *proto != NULL; | 617 *proto != NULL; |
618 ++proto) { | 618 ++proto) { |
619 parent_key.resize(base_length); | 619 parent_key.resize(base_length); |
620 file_util::AppendToPath(&parent_key, *proto); | 620 file_util::AppendToPath(&parent_key, *proto); |
621 child_key.assign(parent_key).append(ShellUtil::kRegShellOpen); | 621 child_key.assign(parent_key).append(ShellUtil::kRegShellOpen); |
622 InstallUtil::DeleteRegistryKeyIf(root, parent_key, child_key, L"", | 622 InstallUtil::DeleteRegistryKeyIf(root, parent_key, child_key, L"", |
623 open_command_pred); | 623 open_command_pred); |
624 } | 624 } |
625 | 625 |
626 // Delete each filetype association if it references this Chrome. | 626 // Note that we do not attempt to delete filetype associations since MSDN |
627 InstallUtil::ValueEquals prog_id_pred(ShellUtil::kChromeHTMLProgId + | 627 // says "Windows respects the Default value only if the ProgID found there is |
628 browser_entry_suffix); | 628 // a registered ProgID. If the ProgID is unregistered, it is ignored." |
629 for (const wchar_t* const* filetype = &ShellUtil::kFileAssociations[0]; | |
630 *filetype != NULL; ++filetype) { | |
631 parent_key.resize(base_length); | |
632 file_util::AppendToPath(&parent_key, *filetype); | |
633 InstallUtil::DeleteRegistryKeyIf(root, parent_key, parent_key, L"", | |
634 prog_id_pred); | |
635 } | |
636 | 629 |
637 *exit_code = installer::UNINSTALL_SUCCESSFUL; | 630 *exit_code = installer::UNINSTALL_SUCCESSFUL; |
638 return true; | 631 return true; |
639 } | 632 } |
640 | 633 |
641 void RemoveChromeLegacyRegistryKeys(BrowserDistribution* dist) { | 634 void RemoveChromeLegacyRegistryKeys(BrowserDistribution* dist) { |
642 // We used to register Chrome to handle crx files, but this turned out | 635 // We used to register Chrome to handle crx files, but this turned out |
643 // to be not worth the hassle. Remove these old registry entries if | 636 // to be not worth the hassle. Remove these old registry entries if |
644 // they exist. See: http://codereview.chromium.org/210007 | 637 // they exist. See: http://codereview.chromium.org/210007 |
645 | 638 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 | 893 |
901 // Try and delete the preserved local state once the post-install | 894 // Try and delete the preserved local state once the post-install |
902 // operations are complete. | 895 // operations are complete. |
903 if (!backup_state_file.empty()) | 896 if (!backup_state_file.empty()) |
904 file_util::Delete(backup_state_file, false); | 897 file_util::Delete(backup_state_file, false); |
905 | 898 |
906 return ret; | 899 return ret; |
907 } | 900 } |
908 | 901 |
909 } // namespace installer | 902 } // namespace installer |
OLD | NEW |