| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Use <code>chrome.pushMessaging</code> to enable apps and extensions to | 5 // The <code>chrome.pushMessaging</code> API is deprecated since Chrome 38, |
| 6 // receive message data sent through | 6 // and will no longer be supported in Chrome 41. |
| 7 // Switch to <code>$(ref:gcm chrome.gcm)</code> to take advantage of |
| 7 // <a href="cloudMessaging.html">Google Cloud Messaging</a>. | 8 // <a href="cloudMessaging.html">Google Cloud Messaging</a>. |
| 9 [deprecated="Use $(ref:gcm chrome.gcm) API"] |
| 8 namespace pushMessaging { | 10 namespace pushMessaging { |
| 9 | 11 |
| 10 dictionary Message { | 12 dictionary Message { |
| 11 // The subchannel the message was sent on; | 13 // The subchannel the message was sent on; |
| 12 // only values 0-3 are valid. | 14 // only values 0-3 are valid. |
| 13 long subchannelId; | 15 long subchannelId; |
| 14 | 16 |
| 15 // The payload associated with the message, if any. This should not contain | 17 // The payload associated with the message, if any. This should not contain |
| 16 // any personally identifiable information. | 18 // any personally identifiable information. |
| 17 DOMString payload; | 19 DOMString payload; |
| 18 }; | 20 }; |
| 19 | 21 |
| 20 dictionary ChannelIdResult { | 22 dictionary ChannelIdResult { |
| 21 // The channel ID for this app to use for push messaging. | 23 // The channel ID for this app to use for push messaging. |
| 22 DOMString channelId; | 24 DOMString channelId; |
| 23 }; | 25 }; |
| 24 | 26 |
| 25 callback ChannelIdCallback = void (ChannelIdResult channelId); | 27 callback ChannelIdCallback = void (ChannelIdResult channelId); |
| 26 | 28 |
| 27 interface Functions { | 29 interface Functions { |
| 28 // Retrieves the channel ID associated with this app or extension. | 30 // Retrieves the channel ID associated with this app or extension. |
| 29 // Typically an app or extension will want to send this value | 31 // Typically an app or extension will want to send this value |
| 30 // to its application server so the server can use it | 32 // to its application server so the server can use it |
| 31 // to trigger push messages back to the app or extension. | 33 // to trigger push messages back to the app or extension. |
| 32 // If the interactive flag is set, we will ask the user to log in | 34 // If the interactive flag is set, we will ask the user to log in |
| 33 // when they are not already logged in. | 35 // when they are not already logged in. |
| 36 [deprecated="Use $(ref:gcm chrome.gcm) API"] |
| 34 static void getChannelId(optional boolean interactive, | 37 static void getChannelId(optional boolean interactive, |
| 35 ChannelIdCallback callback); | 38 ChannelIdCallback callback); |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 interface Events { | 41 interface Events { |
| 39 // Fired when a push message has been received. | 42 // Fired when a push message has been received. |
| 40 // |message| : The details associated with the message. | 43 // |message| : The details associated with the message. |
| 44 [deprecated="Use $(ref:gcm chrome.gcm) API"] |
| 41 static void onMessage(Message message); | 45 static void onMessage(Message message); |
| 42 }; | 46 }; |
| 43 }; | 47 }; |
| OLD | NEW |