DescriptionMac: Don't create shortcuts for hosted apps when they are installed
Most noticeably, default apps like Drive, YouTube, etc. appear on
chrome://apps and are downloaded and "installed" whenever a new profile
is created, and so were getting shortcuts created on Mac.
For shortcut creation, Chrome doesn't currently distinguish these
"default" installs from things installed from the WebStore. But the
logic on Mac was incorrectly triggering shortcut creation for all hosted
app installs, which differs from other platforms. On other platforms,
shortcuts for hosted apps can only created via chrome://apps, or the
bookmark app flow.
This has been for happening for new profile creations on Mac since
r316113 (m42), since it caused web_app::ShouldCreateShortcutFor() to
unconditionally return `true` even for automated codepaths.
To fix, skip creation of these hosted app shortcuts on Mac when
triggered by AppShortcutManager::OnExtensionWillBeInstalled() by making
web_app::ShouldCreateShortcutFor(..) more closely follow other
platforms.
However, Mac has the problem that shortcuts can break, and require
repair, across Chrome versions. To address this, use custom logic in
web_app_mac.mm rather than relying on
web_app::ShouldCreateShortcutFor(..) for determining what to upgrade,
and ensure shortcuts are not newly created during a batch upgrade.
When the default app is downloaded and installed on profile creation, a
user can still create a shortcut for these by going to chrome://apps and
selecting "Create Shortcut..." from the context menu.
BUG=571310
TEST=On Mac, create a new profile. Nothing new should appear in
`~Applications/Chrome Apps`. (Note this needs an official build: default
apps are not installed for Chromium).
Committed: https://crrev.com/e5f2cd2dffa0dba08561b04032c8a6221e73826c
Cr-Commit-Position: refs/heads/master@{#369325}
Patch Set 1 #Patch Set 2 : More robust #Patch Set 3 : Still allow upgrades #Patch Set 4 : Wow. That is incredibly complicated #Patch Set 5 : Refine, fix tests. #Patch Set 6 : Restrict to mac #Patch Set 7 : Simpler #
Messages
Total messages: 15 (10 generated)
|