mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Bug 776027 - Pass activity options instead of name through nsIActivityUIGlue. r=fabrice
This commit is contained in:
parent
1134dcec0f
commit
7be181709e
@ -56,16 +56,16 @@ ActivitiesDialog.prototype = {
|
||||
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])
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ contract @mozilla.org/browser/directory-provider;1 {9181eb7c-6f87-11e1-90b1-4f59
|
||||
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
|
||||
|
@ -13,13 +13,13 @@ interface nsIActivityUIGlueCallback : nsISupports
|
||||
/**
|
||||
* 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);
|
||||
};
|
||||
|
@ -264,7 +264,7 @@ let Activities = {
|
||||
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user