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

Unified Diff: chrome/installer/setup/uninstall.cc

Issue 1327793004: Delete Chrome state in registry on uninstall when the user profile is being deleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/uninstall.cc
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 0404b79140a31ff838dfdf374e4a916f057f4b6b..63dc893eeb30eb225eaf27431a9627168d41339f 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -837,7 +837,7 @@ void UninstallActiveSetupEntries(const InstallerState& installer_state,
}
// Removes the persistent blacklist state for the current user. Note: this will
-// not remove the state for users other than the one uninstalling chrome on a
+// not remove the state for users other than the one uninstalling Chrome on a
// system-level install (http://crbug.com/388725). Doing so would require
// extracting the per-user registry hive iteration from
// UninstallActiveSetupEntries so that it could service multiple tasks.
@@ -850,6 +850,25 @@ void RemoveBlacklistState() {
0); // wow64_access
}
+// Removes the persistent state for |distribution| for the current user. Note:
+// this will not remove the state for users other than the one uninstalling
+// Chrome on a system-level install; see RemoveBlacklistState for details.
+void RemoveDistributionRegistryState(BrowserDistribution* distribution) {
+ static const base::char16* const kKeysToPreserve[] = {
+ L"Extensions",
+ L"NativeMessagingHosts",
+ };
+ base::string16 key_name(L"Software\\");
+ key_name += distribution->GetInstallSubDir();
+ // Delete the contents of the distribution key except for those parts used by
+ // outsiders to configure Chrome.
+ DeleteRegistryKeyPartial(
+ HKEY_CURRENT_USER, key_name,
+ std::vector<base::string16>(
+ &kKeysToPreserve[0],
+ &kKeysToPreserve[arraysize(kKeysToPreserve) - 1]));
+}
+
} // namespace
DeleteResult DeleteChromeDirectoriesIfEmpty(
@@ -1339,8 +1358,10 @@ InstallStatus UninstallProduct(const InstallationState& original_state,
}
}
- if (delete_profile)
+ if (delete_profile) {
DeleteUserDataDir(user_data_dir, product.is_chrome_frame());
+ RemoveDistributionRegistryState(browser_dist);
+ }
if (!force_uninstall) {
VLOG(1) << "Uninstallation complete. Launching post-uninstall operations.";
« chrome/installer/setup/setup_util.cc ('K') | « chrome/installer/setup/setup_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698