Chromium Code Reviews| 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( |