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 cdf2ce2e8d54476110471b9401ff15f80737ee87..46f8c06c4ef736ba3d461696b42e1ee720ffe0d5 100644 |
--- a/chrome/browser/extensions/app_shortcut_manager.cc |
+++ b/chrome/browser/extensions/app_shortcut_manager.cc |
@@ -57,7 +57,7 @@ void AppShortcutManager::OnImageLoaded(const gfx::Image& image, |
shortcut_info_.favicon = image; |
} |
- web_app::CreateShortcut(profile_->GetPath(), shortcut_info_); |
+ web_app::CreateShortcuts(shortcut_info_); |
} |
void AppShortcutManager::Observe(int type, |
@@ -76,10 +76,10 @@ void AppShortcutManager::Observe(int type, |
break; |
} |
case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: { |
- std::string extension_id = |
- content::Details<const Extension>(details).ptr()->id(); |
+ const Extension* extension = content::Details<const Extension>( |
+ details).ptr(); |
if (!disable_shortcut_creation_for_tests) |
- web_app::DeleteAllShortcuts(profile_->GetPath(), extension_id); |
+ DeleteApplicationShortcuts(extension); |
break; |
} |
default: |
@@ -139,3 +139,19 @@ void AppShortcutManager::InstallApplicationShortcuts( |
// immediately. |
tracker_.LoadImages(extension, info_list, ImageLoadingTracker::DONT_CACHE); |
} |
+ |
+void AppShortcutManager::DeleteApplicationShortcuts( |
+ const Extension* extension) { |
+ ShellIntegration::ShortcutInfo delete_info; |
+ delete_info.extension_id = extension->id(); |
+ delete_info.url = GURL(extension->launch_web_url()); |
+ delete_info.title = UTF8ToUTF16(extension->name()); |
+ delete_info.description = UTF8ToUTF16(extension->description()); |
+ delete_info.extension_path = extension->path(); |
+ delete_info.is_platform_app = extension->is_platform_app(); |
+ delete_info.create_in_applications_menu = true; |
+ delete_info.create_in_quick_launch_bar = true; |
+ delete_info.create_on_desktop = true; |
+ delete_info.profile_path = profile_->GetPath(); |
+ web_app::DeleteAllShortcuts(delete_info); |
+} |