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

Issue 487693002: ShellUtil: Add generic methods to add/delete Windows file associations. (Closed)

Created:
6 years, 4 months ago by Matt Giuca
Modified:
6 years, 1 month ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Project:
chromium
Visibility:
Public.

Description

ShellUtil: Add generic methods to add/delete Windows file associations. The existing file handler registration code in ShellUtil was highly specific to Chrome (and the necessary actions to register a web browser). Refactored the code and split it up so that there is reusable code for general (non-browser app) file handler registrations. Added AddFileAssociations and DeleteFileAssociations, which can register and unregister file handlers for any command line and for any file extensions. These are intended to be used when installing/uninstalling Chrome apps with file_handlers in their manifest. BUG=130455 Committed: https://crrev.com/33dfd20c12513837f23d41452c7f8cfdec9a9e6a Cr-Commit-Position: refs/heads/master@{#297814}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fix include order (see crbug.com/404978) and lint errors. #

Total comments: 9

Patch Set 3 : Rebase. #

Patch Set 4 : DeleteWindowsFileAssociations: Don't ignore errors. #

Patch Set 5 : Full refactor, moving implementation into ShellUtil and using RegistryEntry. #

Patch Set 6 : Rebase. #

Patch Set 7 : Rebase. #

Patch Set 8 : Deeper refactoring of the existing file associations code for code reuse. #

Total comments: 3

Patch Set 9 : Do write app_id even without delegateexecute. But not if it's empty. #

Patch Set 10 : Rebase. #

Total comments: 43

Patch Set 11 : Respond to gab's comments. #

Patch Set 12 : Added a TODO. #

Total comments: 22

Patch Set 13 : Respond to grt's comments. #

Total comments: 12

Patch Set 14 : Rebase. #

Patch Set 15 : Reword. #

Patch Set 16 : Fix call to OverrideRegistry. #

Patch Set 17 : Deleted win_file_associator and just use shell_util. #

Patch Set 18 : Added TODO. #

Total comments: 31

Patch Set 19 : Lots of changes. #

Patch Set 20 : Added comments as a result of Windows 8 default association investigation. #

Patch Set 21 : Minor comment change. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+437 lines, -75 lines) Patch
M chrome/installer/util/shell_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +34 lines, -0 lines 0 comments Download
M chrome/installer/util/shell_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 13 chunks +267 lines, -75 lines 7 comments Download
M chrome/installer/util/shell_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +136 lines, -0 lines 0 comments Download

Messages

Total messages: 56 (8 generated)
Matt Giuca
jackhou: Maybe you can take a first look at this in Sydney before I send ...
6 years, 4 months ago (2014-08-19 07:36:20 UTC) #1
jackhou1
https://codereview.chromium.org/487693002/diff/1/chrome/browser/file_associations_win.cc File chrome/browser/file_associations_win.cc (right): https://codereview.chromium.org/487693002/diff/1/chrome/browser/file_associations_win.cc#newcode40 chrome/browser/file_associations_win.cc:40: LOG(ERROR) << "Could not create HKEY_CURRENT_USER\\" << key_name; I ...
6 years, 4 months ago (2014-08-19 08:16:54 UTC) #2
Matt Giuca
https://codereview.chromium.org/487693002/diff/1/chrome/browser/file_associations_win.cc File chrome/browser/file_associations_win.cc (right): https://codereview.chromium.org/487693002/diff/1/chrome/browser/file_associations_win.cc#newcode40 chrome/browser/file_associations_win.cc:40: LOG(ERROR) << "Could not create HKEY_CURRENT_USER\\" << key_name; Hmm ...
6 years, 4 months ago (2014-08-19 08:24:49 UTC) #3
jackhou1
https://codereview.chromium.org/487693002/diff/1/chrome/browser/file_associations_win.cc File chrome/browser/file_associations_win.cc (right): https://codereview.chromium.org/487693002/diff/1/chrome/browser/file_associations_win.cc#newcode182 chrome/browser/file_associations_win.cc:182: bool DeleteWindowsFileAssociations(const std::string& progid) { On 2014/08/19 08:24:48, Matt ...
6 years, 4 months ago (2014-08-19 08:40:03 UTC) #4
Matt Giuca
Hi Carlos, can you take a look at this Windows-registry-heavy CL? (I've heard you're knowledgeable ...
6 years, 4 months ago (2014-08-22 03:48:58 UTC) #5
cpu_(ooo_6.6-7.5)
The right person is grt@ but he is currently OOO but I imagine that robertshield ...
6 years, 4 months ago (2014-08-22 21:49:53 UTC) #6
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/487693002/diff/20001/chrome/browser/file_associations_win.cc File chrome/browser/file_associations_win.cc (right): https://codereview.chromium.org/487693002/diff/20001/chrome/browser/file_associations_win.cc#newcode23 chrome/browser/file_associations_win.cc:23: const wchar_t kRegClassesRootAlias[] = L"Software\\Classes"; I am going to ...
6 years, 4 months ago (2014-08-22 22:03:33 UTC) #7
Matt Giuca
+grt, should be back on Thursday. It looks like the big issue is whether or ...
6 years, 3 months ago (2014-08-25 00:58:18 UTC) #8
robertshield
Added a few comments here. The code does look great, but generally I agree that ...
6 years, 3 months ago (2014-08-25 02:45:22 UTC) #9
Matt Giuca
Thanks for the response. I'll wait for some other people to chime in before doing ...
6 years, 3 months ago (2014-08-25 03:15:42 UTC) #10
robertshield
https://codereview.chromium.org/487693002/diff/20001/chrome/browser/file_associations_win.cc File chrome/browser/file_associations_win.cc (right): https://codereview.chromium.org/487693002/diff/20001/chrome/browser/file_associations_win.cc#newcode141 chrome/browser/file_associations_win.cc:141: // Under OpenWithProgids, create an empty value with this ...
6 years, 3 months ago (2014-08-25 13:13:45 UTC) #11
gab
Seems it would be nice to have a generic class that uses WorkItemList and is ...
6 years, 3 months ago (2014-08-25 21:12:55 UTC) #12
Matt Giuca
Patchset #3 (id:40001) has been deleted
6 years, 3 months ago (2014-08-27 06:07:58 UTC) #13
Matt Giuca
OK, given your collective feedback to reuse ShellUtil, I have refactored the whole patch to ...
6 years, 3 months ago (2014-08-27 08:54:05 UTC) #14
gab
On 2014/08/27 08:54:05, Matt Giuca wrote: > OK, given your collective feedback to reuse ShellUtil, ...
6 years, 3 months ago (2014-08-27 19:45:20 UTC) #15
Matt Giuca
Hi Gab, > Yes, refactoring RegistryEntry makes sense to me. It was initially built like ...
6 years, 3 months ago (2014-09-01 13:07:30 UTC) #16
gab
On 2014/09/01 13:07:30, Matt Giuca wrote: > Hi Gab, > > > Yes, refactoring RegistryEntry ...
6 years, 3 months ago (2014-09-04 03:37:22 UTC) #17
Matt Giuca
> Ah ok, I see what you mean, you want to make RegistryEntry generic while ...
6 years, 3 months ago (2014-09-08 06:30:04 UTC) #18
gab
SGTM, seeing the minimal patch without code duplication will help guide decisions as to what ...
6 years, 3 months ago (2014-09-08 13:41:45 UTC) #19
Matt Giuca
Hi, I've refactored the existing code so that there are now three generic methods for ...
6 years, 3 months ago (2014-09-11 08:23:55 UTC) #21
Matt Giuca
https://codereview.chromium.org/487693002/diff/180001/chrome/installer/util/shell_util.cc File chrome/installer/util/shell_util.cc (right): https://codereview.chromium.org/487693002/diff/180001/chrome/installer/util/shell_util.cc#newcode379 chrome/installer/util/shell_util.cc:379: if (app_info.set_delegate_execute) { Actually, I think this was a ...
6 years, 3 months ago (2014-09-12 00:09:46 UTC) #22
gab
lg! I agree with you that this code is growing out of control though! Extracting ...
6 years, 3 months ago (2014-09-12 13:32:37 UTC) #23
Matt Giuca
https://codereview.chromium.org/487693002/diff/220001/chrome/browser/file_associations_win.h File chrome/browser/file_associations_win.h (right): https://codereview.chromium.org/487693002/diff/220001/chrome/browser/file_associations_win.h#newcode1 chrome/browser/file_associations_win.h:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
6 years, 3 months ago (2014-09-15 03:49:46 UTC) #25
Matt Giuca
Note: I haven't looked at the Windows-8-specific stuff yet. I'm testing it out now.
6 years, 3 months ago (2014-09-15 03:50:09 UTC) #26
grt (UTC plus 2)
https://codereview.chromium.org/487693002/diff/220001/chrome/browser/file_associations_win_unittest.cc File chrome/browser/file_associations_win_unittest.cc (right): https://codereview.chromium.org/487693002/diff/220001/chrome/browser/file_associations_win_unittest.cc#newcode18 chrome/browser/file_associations_win_unittest.cc:18: // these classes and extensions will be deleted from ...
6 years, 3 months ago (2014-09-15 13:38:38 UTC) #27
Matt Giuca
https://codereview.chromium.org/487693002/diff/220001/chrome/browser/file_associations_win_unittest.cc File chrome/browser/file_associations_win_unittest.cc (right): https://codereview.chromium.org/487693002/diff/220001/chrome/browser/file_associations_win_unittest.cc#newcode18 chrome/browser/file_associations_win_unittest.cc:18: // these classes and extensions will be deleted from ...
6 years, 3 months ago (2014-09-16 07:29:13 UTC) #29
grt (UTC plus 2)
LGTM. I don't care for the charset conversions, but I won't scream too loudly. https://codereview.chromium.org/487693002/diff/280001/chrome/browser/file_associations_win.cc ...
6 years, 3 months ago (2014-09-16 13:34:56 UTC) #30
grt (UTC plus 2)
On 2014/09/16 13:34:56, grt wrote: > LGTM. I don't care for the charset conversions, but ...
6 years, 3 months ago (2014-09-16 13:35:37 UTC) #31
Matt Giuca
https://codereview.chromium.org/487693002/diff/280001/chrome/browser/file_associations_win.cc File chrome/browser/file_associations_win.cc (right): https://codereview.chromium.org/487693002/diff/280001/chrome/browser/file_associations_win.cc#newcode12 chrome/browser/file_associations_win.cc:12: bool AddWindowsFileAssociations(const std::string& progid, Yeah, that would be unfortunate, ...
6 years, 3 months ago (2014-09-18 00:07:05 UTC) #32
gab
lg, a few more things below. https://codereview.chromium.org/487693002/diff/220001/chrome/browser/file_associations_win.cc File chrome/browser/file_associations_win.cc (right): https://codereview.chromium.org/487693002/diff/220001/chrome/browser/file_associations_win.cc#newcode33 chrome/browser/file_associations_win.cc:33: SHCNE_ASSOCCHANGED, SHCNF_IDLIST | ...
6 years, 3 months ago (2014-09-18 01:16:15 UTC) #33
grt (UTC plus 2)
https://codereview.chromium.org/487693002/diff/280001/chrome/installer/util/shell_util.cc File chrome/installer/util/shell_util.cc (right): https://codereview.chromium.org/487693002/diff/280001/chrome/installer/util/shell_util.cc#newcode2477 chrome/installer/util/shell_util.cc:2477: // http://msdn.microsoft.com/en-us/library/windows/desktop/cc144148.aspx On 2014/09/18 00:07:04, Matt Giuca wrote: > ...
6 years, 3 months ago (2014-09-18 12:58:02 UTC) #34
Matt Giuca
Deleted file_associations_win module; the client will just directly use shell_util. This should be good to ...
6 years, 2 months ago (2014-09-30 10:21:12 UTC) #36
cpu_(ooo_6.6-7.5)
I've seen the fly-in for other types beyond html, but I have to say not ...
6 years, 2 months ago (2014-09-30 20:27:33 UTC) #37
gab
On 2014/09/30 20:27:33, cpu wrote: > I've seen the fly-in for other types beyond html, ...
6 years, 2 months ago (2014-10-01 14:14:08 UTC) #38
gab
lgtm w/ nits/comments below (and follow up CLs for TODOs). I think you'll want to ...
6 years, 2 months ago (2014-10-01 14:31:11 UTC) #39
grt (UTC plus 2)
https://codereview.chromium.org/487693002/diff/440001/chrome/installer/util/shell_util.cc File chrome/installer/util/shell_util.cc (right): https://codereview.chromium.org/487693002/diff/440001/chrome/installer/util/shell_util.cc#newcode202 chrome/installer/util/shell_util.cc:202: // The unique internal name Windows will use for ...
6 years, 2 months ago (2014-10-01 16:28:39 UTC) #40
grt (UTC plus 2)
please refresh the CL description as well, thanks.
6 years, 2 months ago (2014-10-01 17:25:45 UTC) #41
Matt Giuca
Hopefully that addresses all the comments. Since I have LGTMs (and didn't change the code ...
6 years, 2 months ago (2014-10-02 09:36:34 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/487693002/520001
6 years, 2 months ago (2014-10-02 09:38:05 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_dbg/builds/4350)
6 years, 2 months ago (2014-10-02 09:48:43 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/487693002/520001
6 years, 2 months ago (2014-10-02 11:58:09 UTC) #49
commit-bot: I haz the power
Committed patchset #21 (id:520001) as 9b831d06baa5c0b0b4f20840c92fdbda41fe3126
6 years, 2 months ago (2014-10-02 12:35:32 UTC) #50
commit-bot: I haz the power
Patchset 21 (id:??) landed as https://crrev.com/33dfd20c12513837f23d41452c7f8cfdec9a9e6a Cr-Commit-Position: refs/heads/master@{#297814}
6 years, 2 months ago (2014-10-02 12:36:13 UTC) #51
gab
Awesome, thanks. The result of your Win8 investigation makes sense to me. I guess the ...
6 years, 2 months ago (2014-10-02 13:03:59 UTC) #52
Matt Giuca
https://codereview.chromium.org/487693002/diff/520001/chrome/installer/util/shell_util.cc File chrome/installer/util/shell_util.cc (right): https://codereview.chromium.org/487693002/diff/520001/chrome/installer/util/shell_util.cc#newcode311 chrome/installer/util/shell_util.cc:311: // user readable/localized strings. See relevant MSDN article: I ...
6 years, 2 months ago (2014-10-03 00:26:40 UTC) #53
gab
More details below; I do think this check is worthwhile (and in fact you'll need ...
6 years, 2 months ago (2014-10-03 15:26:25 UTC) #54
gab
https://codereview.chromium.org/487693002/diff/520001/chrome/installer/util/shell_util.cc File chrome/installer/util/shell_util.cc (right): https://codereview.chromium.org/487693002/diff/520001/chrome/installer/util/shell_util.cc#newcode353 chrome/installer/util/shell_util.cc:353: DCHECK_NE(L'.', app_info.prog_id[0]); On 2014/10/03 15:26:25, gab wrote: > On ...
6 years, 1 month ago (2014-11-05 15:47:41 UTC) #55
Matt Giuca
6 years, 1 month ago (2014-11-05 23:00:06 UTC) #56
Message was sent while issue was closed.
I was planning to leave these follow-ups till after branch point. I have a lot
of things that need attention before then.

Powered by Google App Engine
This is Rietveld 408576698