Bug 760708 - Remove shortcuts when they're added through about:apps. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Wed, 06 Jun 2012 13:52:32 -0700
changeset 98731 eb7306640e5f3b292ce07e8fec1a7dda518455d5
parent 98730 762be48017394066b64bc4d56ece5cf00653db7b
child 98732 d529eceaccfaadfc1931375a6768bbac43405320
push id1729
push userlsblakk@mozilla.com
push dateMon, 16 Jul 2012 20:02:43 +0000
treeherdermozilla-aurora@f4e75e148951 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs760708
milestone16.0a1
Bug 760708 - Remove shortcuts when they're added through about:apps. r=mfinkle
mobile/android/chrome/content/aboutApps.js
--- a/mobile/android/chrome/content/aboutApps.js
+++ b/mobile/android/chrome/content/aboutApps.js
@@ -44,16 +44,26 @@ function onLoad(aEvent) {
   AppsUI.shortcut = contextmenus.add(gStrings.GetStringFromName("appsContext.shortcut"), contextmenus.SelectorContext("div[mozApp]"),
     function(aTarget) {
       let manifest = aTarget.manifest;
       gChromeWin.WebappsUI.createShortcut(manifest.name, manifest.fullLaunchPath(), manifest.iconURLForSize("64"), "webapp");
     });
   AppsUI.uninstall = contextmenus.add(gStrings.GetStringFromName("appsContext.uninstall"), contextmenus.SelectorContext("div[mozApp]"),
     function(aTarget) {
       aTarget.app.uninstall();
+
+      let manifest = aTarget.manifest;
+      gChromeWin.sendMessageToJava({
+        gecko: {
+          type: "Shortcut:Remove",
+          title: manifest.name,
+          url: manifest.fullLaunchPath(),
+          shortcutType: "webapp"
+        }
+      });
     });
 }
 
 function onUnload(aEvent) {
   let contextmenus = gChromeWin.NativeWindow.contextmenus;
   if (AppsUI.shortcut)
     contextmenus.remove(AppsUI.shortcut);
   if (AppsUI.uninstall)