diff options
Diffstat (limited to 'chrome/browser/web_applications/web_app_mac.mm')
-rw-r--r-- | chrome/browser/web_applications/web_app_mac.mm | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm index 46b689b..903f243 100644 --- a/chrome/browser/web_applications/web_app_mac.mm +++ b/chrome/browser/web_applications/web_app_mac.mm @@ -417,6 +417,17 @@ ShellIntegration::ShortcutInfo BuildShortcutInfoFromBundle( return shortcut_info; } +void CreateShortcutsAndRunCallback( + const base::Closure& close_callback, + const ShellIntegration::ShortcutInfo& shortcut_info) { + // creation_locations will be ignored by CreatePlatformShortcuts on Mac. + ShellIntegration::ShortcutLocations creation_locations; + web_app::CreateShortcuts(shortcut_info, creation_locations, + web_app::SHORTCUT_CREATION_BY_USER); + if (!close_callback.is_null()) + close_callback.Run(); +} + } // namespace namespace chrome { @@ -426,13 +437,10 @@ void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow /*parent_window*/, const extensions::Extension* app, const base::Closure& close_callback) { // Normally we would show a dialog, but since we always create the app - // shortcut in ~/Applications there are no options for the user to choose. - web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER, - ShellIntegration::ShortcutLocations(), - profile, - app); - if (!close_callback.is_null()) - close_callback.Run(); + // shortcut in /Applications there are no options for the user to choose. + web_app::UpdateShortcutInfoAndIconForApp( + app, profile, + base::Bind(&CreateShortcutsAndRunCallback, close_callback)); } } // namespace chrome |