From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- b2g/components/nsISystemMessagesInternal.idl | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 b2g/components/nsISystemMessagesInternal.idl (limited to 'b2g/components/nsISystemMessagesInternal.idl') diff --git a/b2g/components/nsISystemMessagesInternal.idl b/b2g/components/nsISystemMessagesInternal.idl new file mode 100644 index 000000000..775ce0315 --- /dev/null +++ b/b2g/components/nsISystemMessagesInternal.idl @@ -0,0 +1,51 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "domstubs.idl" + +interface nsIURI; +interface nsIDOMWindow; +interface nsIMessageSender; + +// Implemented by the contract id @mozilla.org/system-message-internal;1 + +[scriptable, uuid(59b6beda-f911-4d47-a296-8c81e6abcfb9)] +interface nsISystemMessagesInternal : nsISupports +{ + /* + * Allow any internal user to send a message of a given type to a given page + * of an app. The message will be sent to all the registered pages of the app + * when |pageURI| is not specified. + * @param type The type of the message to be sent. + * @param message The message payload. + * @param pageURI The URI of the page that will be opened. Nullable. + * @param manifestURI The webapp's manifest URI. + * @param extra Extra opaque information that will be passed around in the observer + * notification to open the page. + * returns a Promise + */ + nsISupports sendMessage(in DOMString type, in jsval message, + in nsIURI pageURI, in nsIURI manifestURI, + [optional] in jsval extra); + + /* + * Allow any internal user to broadcast a message of a given type. + * The application that registers the message will be launched. + * @param type The type of the message to be sent. + * @param message The message payload. + * @param extra Extra opaque information that will be passed around in the observer + * notification to open the page. + * returns a Promise + */ + nsISupports broadcastMessage(in DOMString type, in jsval message, + [optional] in jsval extra); + + /* + * Registration of a page that wants to be notified of a message type. + * @param type The message type. + * @param pageURI The URI of the page that will be opened. + * @param manifestURI The webapp's manifest URI. + */ + void registerPage(in DOMString type, in nsIURI pageURI, in nsIURI manifestURI); +}; -- cgit v1.2.3