Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: chrome/installer/setup/uninstall.cc

Issue 1473813003: Add a GetRegistryPath method to BrowserDistribution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 851 }
852 852
853 // Removes the persistent state for |distribution| for the current user. Note: 853 // Removes the persistent state for |distribution| for the current user. Note:
854 // this will not remove the state for users other than the one uninstalling 854 // this will not remove the state for users other than the one uninstalling
855 // Chrome on a system-level install; see RemoveBlacklistState for details. 855 // Chrome on a system-level install; see RemoveBlacklistState for details.
856 void RemoveDistributionRegistryState(BrowserDistribution* distribution) { 856 void RemoveDistributionRegistryState(BrowserDistribution* distribution) {
857 static const base::char16* const kKeysToPreserve[] = { 857 static const base::char16* const kKeysToPreserve[] = {
858 L"Extensions", 858 L"Extensions",
859 L"NativeMessagingHosts", 859 L"NativeMessagingHosts",
860 }; 860 };
861 base::string16 key_name(L"Software\\");
862 key_name += distribution->GetInstallSubDir();
863 // Delete the contents of the distribution key except for those parts used by 861 // Delete the contents of the distribution key except for those parts used by
864 // outsiders to configure Chrome. 862 // outsiders to configure Chrome.
865 DeleteRegistryKeyPartial( 863 DeleteRegistryKeyPartial(
866 HKEY_CURRENT_USER, key_name, 864 HKEY_CURRENT_USER, distribution->GetRegistryPath(),
867 std::vector<base::string16>( 865 std::vector<base::string16>(
868 &kKeysToPreserve[0], 866 &kKeysToPreserve[0],
869 &kKeysToPreserve[arraysize(kKeysToPreserve) - 1])); 867 &kKeysToPreserve[arraysize(kKeysToPreserve) - 1]));
870 } 868 }
871 869
872 } // namespace 870 } // namespace
873 871
874 DeleteResult DeleteChromeDirectoriesIfEmpty( 872 DeleteResult DeleteChromeDirectoriesIfEmpty(
875 const base::FilePath& application_directory) { 873 const base::FilePath& application_directory) {
876 DeleteResult result(DeleteEmptyDir(application_directory)); 874 DeleteResult result(DeleteEmptyDir(application_directory));
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 // If we need a reboot to continue, schedule the parent directories for 1437 // If we need a reboot to continue, schedule the parent directories for
1440 // deletion unconditionally. If they are not empty, the session manager 1438 // deletion unconditionally. If they are not empty, the session manager
1441 // will not delete them on reboot. 1439 // will not delete them on reboot.
1442 ScheduleParentAndGrandparentForDeletion(target_path); 1440 ScheduleParentAndGrandparentForDeletion(target_path);
1443 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { 1441 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) {
1444 *uninstall_status = UNINSTALL_FAILED; 1442 *uninstall_status = UNINSTALL_FAILED;
1445 } 1443 }
1446 } 1444 }
1447 1445
1448 } // namespace installer 1446 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698