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