Index: chrome/browser/ui/views/create_application_shortcut_view.cc |
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc |
index b9dd297887f624008a1836eb0f39443fe1d7f34b..54a0d3528261a735ae72b89f83dc9758c891d1e5 100644 |
--- a/chrome/browser/ui/views/create_application_shortcut_view.cc |
+++ b/chrome/browser/ui/views/create_application_shortcut_view.cc |
@@ -532,6 +532,14 @@ CreateChromeApplicationShortcutView::CreateChromeApplicationShortcutView( |
create_in_chrome_apps_subdir_ = true; |
InitControls(DIALOG_LAYOUT_APP_SHORTCUT); |
+ |
+ // Get shortcut information and icon; they are needed for creating the |
+ // shortcut. |
+ web_app::UpdateShortcutInfoAndIconForApp( |
+ app, |
+ profile, |
+ base::Bind(&CreateChromeApplicationShortcutView::OnShortcutInfoLoaded, |
+ weak_ptr_factory_.GetWeakPtr())); |
} |
CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {} |
@@ -547,3 +555,9 @@ bool CreateChromeApplicationShortcutView::Cancel() { |
close_callback_.Run(false); |
return CreateApplicationShortcutView::Cancel(); |
} |
+ |
+// Called when the app's ShortcutInfo (with icon) is loaded. |
+void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( |
+ const web_app::ShortcutInfo& shortcut_info) { |
+ shortcut_info_ = shortcut_info; |
+} |