Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: tools/dom/src/chrome/push_messaging.dart

Issue 12316032: Added more Chrome.* libraries to dart:chrome (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added isMaximised override file Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/src/chrome/media_galleries_private.dart ('k') | tools/dom/src/chrome/serial.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Generated from namespace: pushMessaging
6
7 part of chrome;
8
9 /**
10 * Types
11 */
12
13 class PushmessagingMessage extends ChromeObject {
14 /*
15 * Public constructor
16 */
17 PushmessagingMessage({int subchannelId, String payload}) {
18 if (?subchannelId)
19 this.subchannelId = subchannelId;
20 if (?payload)
21 this.payload = payload;
22 }
23
24 /*
25 * Private constructor
26 */
27 PushmessagingMessage._proxy(_jsObject) : super._proxy(_jsObject);
28
29 /*
30 * Public accessors
31 */
32 /// The subchannel the message was sent on; only values 0-3 are valid.
33 int get subchannelId => JS('int', '#.subchannelId', this._jsObject);
34
35 void set subchannelId(int subchannelId) {
36 JS('void', '#.subchannelId = #', this._jsObject, subchannelId);
37 }
38
39 /// The payload associated with the message, if any.
40 String get payload => JS('String', '#.payload', this._jsObject);
41
42 void set payload(String payload) {
43 JS('void', '#.payload = #', this._jsObject, payload);
44 }
45
46 }
47
48 class PushmessagingChannelIdResult extends ChromeObject {
49 /*
50 * Public constructor
51 */
52 PushmessagingChannelIdResult({String channelId}) {
53 if (?channelId)
54 this.channelId = channelId;
55 }
56
57 /*
58 * Private constructor
59 */
60 PushmessagingChannelIdResult._proxy(_jsObject) : super._proxy(_jsObject);
61
62 /*
63 * Public accessors
64 */
65 /// The channel ID for this app to use for push messaging.
66 String get channelId => JS('String', '#.channelId', this._jsObject);
67
68 void set channelId(String channelId) {
69 JS('void', '#.channelId = #', this._jsObject, channelId);
70 }
71
72 }
73
74 /**
75 * Events
76 */
77
78 /// Fired when a push message has been received.
79 class Event_push_messaging_onMessage extends Event {
80 void addListener(void callback(PushmessagingMessage message)) {
81 void __proxy_callback(message) {
82 if (?callback) {
83 callback(new PushmessagingMessage._proxy(message));
84 }
85 }
86 super.addListener(callback);
87 }
88
89 void removeListener(void callback(PushmessagingMessage message)) {
90 void __proxy_callback(message) {
91 if (?callback) {
92 callback(new PushmessagingMessage._proxy(message));
93 }
94 }
95 super.removeListener(callback);
96 }
97
98 bool hasListener(void callback(PushmessagingMessage message)) {
99 void __proxy_callback(message) {
100 if (?callback) {
101 callback(new PushmessagingMessage._proxy(message));
102 }
103 }
104 super.hasListener(callback);
105 }
106
107 Event_push_messaging_onMessage(jsObject) : super._(jsObject, 1);
108 }
109
110 /**
111 * Functions
112 */
113
114 class API_push_messaging {
115 /*
116 * API connection
117 */
118 Object _jsObject;
119
120 /*
121 * Events
122 */
123 Event_push_messaging_onMessage onMessage;
124
125 /*
126 * Functions
127 */
128 /// Retrieves the channel ID associated with this app or extension. Typically
129 /// an app or extension will want to send this value to its application server
130 /// so the server can use it to trigger push messages back to the app or
131 /// extension. If the interactive flag is set, we will ask the user to log in
132 /// when they are not already logged in.
133 void getChannelId(void callback(PushmessagingChannelIdResult channelId), [bool interactive]) {
134 void __proxy_callback(channelId) {
135 if (?callback) {
136 callback(new PushmessagingChannelIdResult._proxy(channelId));
137 }
138 }
139 JS('void', '#.getChannelId(#, #)', this._jsObject, interactive, convertDartC losureToJS(__proxy_callback, 1));
140 }
141
142 API_push_messaging(this._jsObject) {
143 onMessage = new Event_push_messaging_onMessage(JS('', '#.onMessage', this._j sObject));
144 }
145 }
OLDNEW
« no previous file with comments | « tools/dom/src/chrome/media_galleries_private.dart ('k') | tools/dom/src/chrome/serial.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698