Index: chrome/browser/web_applications/web_app.cc |
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc |
index 1aec9ac61ed0c284080c8cc7d83d9871b099f5da..7ed0cefb9f4d86c0c9aba104d05db93689201488 100644 |
--- a/chrome/browser/web_applications/web_app.cc |
+++ b/chrome/browser/web_applications/web_app.cc |
@@ -310,16 +310,32 @@ bool ShouldCreateShortcutFor(web_app::ShortcutCreationReason reason, |
return false; |
} |
- // Otherwise, always create shortcuts for v2 packaged apps. |
+ // Always create shortcuts for v2 packaged apps. |
if (extension->is_platform_app()) |
return true; |
#if defined(OS_MACOSX) |
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kDisableHostedAppShimCreation)) { |
- return extension->is_hosted_app(); |
+ // A bookmark app installs itself as an extension, then automatically triggers |
+ // a shortcut request with SHORTCUT_CREATION_AUTOMATED. Allow this flow, but |
+ // do not automatically create shortcuts for default-installed extensions, |
+ // until it is explicitly requested by the user. |
+ if (extension->was_installed_by_default() && |
+ reason == SHORTCUT_CREATION_AUTOMATED) |
+ return false; |
+ |
+ if (extension->from_bookmark()) |
+ return true; |
+ |
+ // Otherwise, don't create shortcuts for automated codepaths. |
+ if (reason == SHORTCUT_CREATION_AUTOMATED) |
+ return false; |
+ |
+ if (extension->is_hosted_app()) { |
+ return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kDisableHostedAppShimCreation); |
} |
+ // Only reached for "legacy" packaged apps. Default to false on Mac. |
return false; |
#else |
// For other platforms, allow shortcut creation if it was explicitly |