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

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

Issue 915973002: Add bookmark apps to taskbar automatically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « chrome/browser/extensions/bookmark_app_helper.cc ('k') | no next file » | 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 b1bd8e1ba55eebdb33d74796277047b8883bc189..80e43b25f46db9991cd8626f9eb968e794057a9d 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -283,17 +283,20 @@ void GetShortcutInfoForApp(const extensions::Extension* extension,
extension, profile, base::Bind(&IgnoreFileHandlersInfo, callback));
}
-bool ShouldCreateShortcutFor(Profile* profile,
+bool ShouldCreateShortcutFor(web_app::ShortcutCreationReason reason,
jackhou1 2015/02/11 07:14:42 Need to update the use of this function in web_app
benwells 2015/02/12 02:09:36 Done.
+ Profile* profile,
const extensions::Extension* extension) {
- bool app_type_requires_shortcut = extension->is_platform_app();
+ // Only create shortcuts automatically if they are platform apps.
+ bool app_type_requires_shortcut = extension->is_platform_app() ||
+ reason == SHORTCUT_CREATION_BY_USER;
// An additional check here for OS X. We need app shims to be
// able to show them in the dock.
#if defined(OS_MACOSX)
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
jackhou1 2015/02/11 07:14:42 With the inverted logic, if there's an automatic s
benwells 2015/02/12 02:09:36 Good point. I've update the logic to always create
switches::kEnableHostedAppShimCreation)) {
app_type_requires_shortcut =
- app_type_requires_shortcut || extension->is_hosted_app();
+ app_type_requires_shortcut && !extension->is_hosted_app();
}
#endif
@@ -407,7 +410,7 @@ void CreateShortcuts(ShortcutCreationReason reason,
const extensions::Extension* app) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (!ShouldCreateShortcutFor(profile, app))
+ if (!ShouldCreateShortcutFor(reason, profile, app))
return;
GetInfoForApp(
« no previous file with comments | « chrome/browser/extensions/bookmark_app_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698