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 96016 eb7306640e5f3b292ce07e8fec1a7dda518455d5
parent 96015 762be48017394066b64bc4d56ece5cf00653db7b
child 96017 d529eceaccfaadfc1931375a6768bbac43405320
push id22869
push useremorley@mozilla.com
push dateThu, 07 Jun 2012 09:35:19 +0000
treeherdermozilla-central@3933384d8315 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs760708
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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)