Bug 776027 - Pass activity options instead of name through nsIActivityUIGlue. r=fabrice
☠☠ backed out by d7f6864d8570 ☠ ☠
authorJosh Dover <gerfuls@gmail.com>
Mon, 14 Apr 2014 17:47:00 +0200
changeset 178396 f8c51b2092cad9b1d86035a80bf7074e0741f58e
parent 178395 33bcd13d52f59caaed9607a526cd261cf2399743
child 178397 2ada015179801c0889ac82e203774eaca2bbd5ef
push id6314
push usercbook@mozilla.com
push dateTue, 15 Apr 2014 09:15:50 +0000
treeherderfx-team@b90d50c9d8be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs776027
milestone31.0a1
Bug 776027 - Pass activity options instead of name through nsIActivityUIGlue. r=fabrice
b2g/components/ActivitiesGlue.js
b2g/components/B2GComponents.manifest
dom/activities/interfaces/nsIActivityUIGlue.idl
dom/activities/src/ActivitiesService.jsm
--- a/b2g/components/ActivitiesGlue.js
+++ b/b2g/components/ActivitiesGlue.js
@@ -51,24 +51,24 @@ ActivitiesDialog.prototype = {
       activity.callback.handleEvent(evt.detail.value !== undefined
                                       ? evt.detail.value
                                       : -1);
     });
 
     SystemAppProxy.dispatchEvent(detail);
   },
 
-  chooseActivity: function ap_chooseActivity(aName, aActivities, aCallback) {
+  chooseActivity: function ap_chooseActivity(aOptions, aActivities, aCallback) {
     this.activities.push({
-      name: aName,
+      name: aOptions.name,
       list: aActivities,
       callback: aCallback
     });
     Services.tm.currentThread.dispatch(this, Ci.nsIEventTarget.DISPATCH_NORMAL);
   },
 
-  classID: Components.ID("{70a83123-7467-4389-a309-3e81c74ad002}"),
+  classID: Components.ID("{3a54788b-48cc-4ab4-93d6-0d6a8ef74f8e}"),
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityUIGlue, Ci.nsIRunnable])
 }
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]);
 
--- a/b2g/components/B2GComponents.manifest
+++ b/b2g/components/B2GComponents.manifest
@@ -16,18 +16,18 @@ contract @mozilla.org/updates/update-pro
 #endif
 
 # DirectoryProvider.js
 component {9181eb7c-6f87-11e1-90b1-4f59d80dd2e5} DirectoryProvider.js
 contract @mozilla.org/browser/directory-provider;1 {9181eb7c-6f87-11e1-90b1-4f59d80dd2e5}
 category xpcom-directory-providers browser-directory-provider @mozilla.org/browser/directory-provider;1
 
 # ActivitiesGlue.js
-component {70a83123-7467-4389-a309-3e81c74ad002} ActivitiesGlue.js
-contract @mozilla.org/dom/activities/ui-glue;1 {70a83123-7467-4389-a309-3e81c74ad002}
+component {3a54788b-48cc-4ab4-93d6-0d6a8ef74f8e} ActivitiesGlue.js
+contract @mozilla.org/dom/activities/ui-glue;1 {3a54788b-48cc-4ab4-93d6-0d6a8ef74f8e}
 
 # ProcessGlobal.js
 component {1a94c87a-5ece-4d11-91e1-d29c29f21b28} ProcessGlobal.js
 contract @mozilla.org/b2g-process-global;1 {1a94c87a-5ece-4d11-91e1-d29c29f21b28}
 category app-startup ProcessGlobal service,@mozilla.org/b2g-process-global;1
 
 # ContentHandler.js
 component {d18d0216-d50c-11e1-ba54-efb18d0ef0ac} ContentHandler.js
--- a/dom/activities/interfaces/nsIActivityUIGlue.idl
+++ b/dom/activities/interfaces/nsIActivityUIGlue.idl
@@ -8,18 +8,18 @@
 interface nsIActivityUIGlueCallback : nsISupports
 {
     void handleEvent(in long choice);
 };
 
 /**
   * To be implemented by @mozilla.org/dom/activities/ui-glue;1
   */
-[scriptable, uuid(8624ad73-937a-400f-9d93-39ab5449b867)]
+[scriptable, uuid(03e6743c-2fc3-43fa-bcb3-0476947c8ac5)]
 interface nsIActivityUIGlue : nsISupports
 {
     /**
-      * @param name        The name of the activity to handle (eg. "share", "pick").
+      * @param options     The ActivityOptions object in the form of { name: "send", data: { ... } }
       * @param activities  A json blob which is an array of { "title":"...", "icon":"..." }.
       * @param onresult    The callback to send the index of the choosen activity. Send -1 if no choice is made.
       */
-    void chooseActivity(in DOMString title, in jsval activities, in nsIActivityUIGlueCallback onresult);
+    void chooseActivity(in jsval options, in jsval activities, in nsIActivityUIGlueCallback onresult);
 };
--- a/dom/activities/src/ActivitiesService.jsm
+++ b/dom/activities/src/ActivitiesService.jsm
@@ -259,17 +259,17 @@ let Activities = {
           // No need to notify observers, since we don't want the caller
           // to be raised on the foreground that quick.
           delete Activities.callers[aMsg.id];
         }
       };
 
       let glue = Cc["@mozilla.org/dom/activities/ui-glue;1"]
                    .createInstance(Ci.nsIActivityUIGlue);
-      glue.chooseActivity(aResults.name, aResults.options, getActivityChoice);
+      glue.chooseActivity(aMsg.options, aResults.options, getActivityChoice);
     };
 
     let errorCb = function errorCb(aError) {
       // Something unexpected happened. Should we send an error back?
       debug("Error in startActivity: " + aError + "\n");
     };
 
     let matchFunc = function matchFunc(aResult) {