| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 namespace pushMessaging{ |
| 6 |
| 7 dictionary Message { |
| 8 // The subchannel the message was sent on; |
| 9 // only values 0-3 are valid. |
| 10 long subchannelId; |
| 11 |
| 12 // The payload associated with the message, if any. |
| 13 DOMString payload; |
| 14 }; |
| 15 |
| 16 dictionary ChannelIdResult { |
| 17 // The channel ID for this app to use for push messaging. |
| 18 DOMString channelId; |
| 19 }; |
| 20 |
| 21 callback ChannelIdCallback = void (ChannelIdResult channelId); |
| 22 |
| 23 interface Functions { |
| 24 // Retrieves the channel ID associated with this app or extension. |
| 25 // Typically an app or extension will want to send this value |
| 26 // to its application server so the server can use it |
| 27 // to trigger push messages back to the app or extension. |
| 28 // If the interactive flag is set, we will ask the user to log in |
| 29 // when they are not already logged in. |
| 30 static void getChannelId(optional boolean interactive, |
| 31 ChannelIdCallback callback); |
| 32 }; |
| 33 |
| 34 interface Events { |
| 35 // Fired when a push message has been received. |
| 36 // |message| : The details associated with the message. |
| 37 static void onMessage(Message message); |
| 38 }; |
| 39 }; |
| OLD | NEW |