Bug 949174/964375/952311 - Send panel JSON instead of just id in HomePanels:Remove (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Wed, 05 Feb 2014 14:14:52 +0000
changeset 178004 9385b83f32c5e81fc2142e2ee61ad42fa86295a1
parent 178003 1a5908740d35263f257513a2c7b5c73e8f0622e4
child 178005 75b2985c88bbb1fb9f7f0ef3fac6382ea0102e2e
push id5439
push userffxbld
push dateMon, 17 Mar 2014 23:08:15 +0000
treeherdermozilla-aurora@c0befb3c8038 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs949174, 964375, 952311
milestone30.0a1
Bug 949174/964375/952311 - Send panel JSON instead of just id in HomePanels:Remove (r=margaret)
mobile/android/modules/Home.jsm
--- a/mobile/android/modules/Home.jsm
+++ b/mobile/android/modules/Home.jsm
@@ -227,21 +227,26 @@ let HomePanels = {
       sendMessageToJava({
         type: "HomePanels:Install",
         panel: this._panelToJSON(panel)
       });
     }
   },
 
   remove: function(id) {
+    if (!(id in this._panels)) {
+      throw "Home.panels: Panel doesn't exist: id = " + id;
+    }
+
+    let panel = this._panels[id];
     delete this._panels[id];
 
     sendMessageToJava({
       type: "HomePanels:Remove",
-      id: id
+      panel: this._panelToJSON(panel)
     });
   },
 
   // Helper function used to see if a value is in an object.
   _valueExists: function(obj, value) {
     for (let key in obj) {
       if (obj[key] == value) {
         return true;