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

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

Issue 10946030: Remove Chrome's ProgID from filetype associations at uninstall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: also notify the shell Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/uninstall.cc
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 209ff786d9f40c42ba3b8f0660fed666e077e168..49420c99f6f7d80501ff822d83c5af33e9d6a926 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -749,6 +749,18 @@ bool DeleteChromeRegistrationKeys(BrowserDistribution* dist, HKEY root,
open_command_pred);
}
+ // Delete each filetype association if it references this Chrome. Don't
+ // delete the whole key since other apps may have stored data there.
+ InstallUtil::ValueEquals prog_id_pred(prog_id);
gab 2012/09/19 16:11:16 |prog_id| here could be suffixed and unsuffixed (b
grt (UTC plus 2) 2012/09/19 19:43:15 Great catch. Updated as discussed.
+ for (const wchar_t* const* filetype = &ShellUtil::kFileAssociations[0];
gab 2012/09/19 16:11:16 I feel this is overly complicated to loop through
grt (UTC plus 2) 2012/09/19 19:43:15 The size of the array isn't known here as it is in
gab 2012/09/19 19:58:50 Hmmm, the suggested code doesn't depend on the siz
grt (UTC plus 2) 2012/09/19 20:04:52 Oh, I see. I read the suggestion as knowing array
+ *filetype != NULL; ++filetype) {
+ parent_key.resize(base_length);
+ parent_key.push_back(FilePath::kSeparators[0]);
gab 2012/09/19 16:11:16 If |parent_key| is always going to have the separa
grt (UTC plus 2) 2012/09/19 19:43:15 Done.
+ parent_key.append(*filetype);
+ InstallUtil::DeleteRegistryValueIf(root, parent_key.c_str(), L"",
gab 2012/09/19 16:11:16 optional: I don't like that this method takes wcha
grt (UTC plus 2) 2012/09/19 19:43:15 Ignored. It's common to call this fn with a liter
+ prog_id_pred);
+ }
+
// Note that we do not attempt to delete filetype associations since MSDN
// says "Windows respects the Default value only if the ProgID found there is
// a registered ProgID. If the ProgID is unregistered, it is ignored."
@@ -1096,6 +1108,10 @@ InstallStatus UninstallProduct(const InstallationState& original_state,
#if 0
UninstallActiveSetupEntries(installer_state, product);
#endif
+
+ // Notify the shell that associations have changed since Chrome was likely
+ // unregistered.
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
}
if (product.is_chrome_frame()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698