Add some abstractions around NSWorkspace methods for shortcuts.
setIcon:forFile: is not re-entrant and thus multiple calls to it need to be sequenced. To ensure this is done, this adds a wrapper around the method that does all the calls to this method on the same SequencedTaskRunner. Existing usage of this method in web apps code is migrated to use the new wrapper. setDefaultApplicationAtURL: toOpenFileAtURL: only exists in macOS 12 and newer. To also support older OS versions, this CL adds a wrapper that uses this method on macOS 12, and hardcodes the implementation of this method for older OS versions. Unit tests verify that this does indeed work even on older OS versions. Bug: 333024272 Change-Id: I64574153e86d6471ed5c94710885c312f4c6356b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459962 Reviewed-by:Avi Drissman <avi@chromium.org> Reviewed-by:
Daniel Murphy <dmurph@chromium.org> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> Cr-Commit-Position: refs/heads/main@{#1288864}
Loading