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

Unified Diff: chrome/browser/web_applications/web_app.cc

Issue 1533273002: Mac: Don't create shortcuts for hosted apps when they are installed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simpler Created 4 years, 11 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 | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698