Index: chrome/browser/extensions/app_shortcut_manager.cc |
diff --git a/chrome/browser/extensions/app_shortcut_manager.cc b/chrome/browser/extensions/app_shortcut_manager.cc |
index 7d1f275403cd833be7008724a10510d3192e9fde..c15f74b79613bca64a4f0bccccc9cf7ab843f266 100644 |
--- a/chrome/browser/extensions/app_shortcut_manager.cc |
+++ b/chrome/browser/extensions/app_shortcut_manager.cc |
@@ -4,8 +4,10 @@ |
#include "chrome/browser/extensions/app_shortcut_manager.h" |
+#include "base/bind.h" |
#include "base/command_line.h" |
#include "base/utf_string_conversions.h" |
+#include "chrome/browser/extensions/app_host_installer.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/web_applications/web_app.h" |
#include "chrome/common/chrome_notification_types.h" |
@@ -99,6 +101,18 @@ void AppShortcutManager::Observe(int type, |
void AppShortcutManager::UpdateApplicationShortcuts( |
const Extension* extension) { |
+ app_host_installer::InstallAppHostIfNecessary( |
+ *extension, base::Bind(&AppShortcutManager::OnAppHostInstallationComplete, |
+ base::Unretained(this), extension)); |
+} |
+ |
+void AppShortcutManager::OnAppHostInstallationComplete( |
+ const Extension* extension, bool app_host_install_success) { |
+ if (!app_host_install_success) { |
+ // Do not create shortcuts if App Host fails to install. |
+ return; |
+ } |
+ |
shortcut_info_ = ShortcutInfoForExtensionAndProfile(extension, profile_); |
std::vector<ImageLoadingTracker::ImageRepresentation> info_list; |