Bug 776027 - Pass activity options instead of name through nsIActivityUIGlue. r=fabrice
authorJosh Dover <gerfuls@gmail.com>
Fri, 25 Apr 2014 16:28:00 +0200
changeset 180948 c15e4803607d883069fc9e274bbb399cb6f3e5b5
parent 180947 95742dfbee4935c374555e354085651904ec8df5
child 180949 025898d5577cd0eee55ce5c5ec757fd55daccac7
push id26687
push usercbook@mozilla.com
push dateWed, 30 Apr 2014 13:02:09 +0000
treeherdermozilla-central@727238c13756 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs776027
milestone32.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 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) {