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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/chrome/push_messaging.dart
diff --git a/tools/dom/src/chrome/push_messaging.dart b/tools/dom/src/chrome/push_messaging.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e304d97580059220346ab02832700bbbd01b94dd
--- /dev/null
+++ b/tools/dom/src/chrome/push_messaging.dart
@@ -0,0 +1,145 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Generated from namespace: pushMessaging
+
+part of chrome;
+
+/**
+ * Types
+ */
+
+class PushmessagingMessage extends ChromeObject {
+ /*
+ * Public constructor
+ */
+ PushmessagingMessage({int subchannelId, String payload}) {
+ if (?subchannelId)
+ this.subchannelId = subchannelId;
+ if (?payload)
+ this.payload = payload;
+ }
+
+ /*
+ * Private constructor
+ */
+ PushmessagingMessage._proxy(_jsObject) : super._proxy(_jsObject);
+
+ /*
+ * Public accessors
+ */
+ /// The subchannel the message was sent on; only values 0-3 are valid.
+ int get subchannelId => JS('int', '#.subchannelId', this._jsObject);
+
+ void set subchannelId(int subchannelId) {
+ JS('void', '#.subchannelId = #', this._jsObject, subchannelId);
+ }
+
+ /// The payload associated with the message, if any.
+ String get payload => JS('String', '#.payload', this._jsObject);
+
+ void set payload(String payload) {
+ JS('void', '#.payload = #', this._jsObject, payload);
+ }
+
+}
+
+class PushmessagingChannelIdResult extends ChromeObject {
+ /*
+ * Public constructor
+ */
+ PushmessagingChannelIdResult({String channelId}) {
+ if (?channelId)
+ this.channelId = channelId;
+ }
+
+ /*
+ * Private constructor
+ */
+ PushmessagingChannelIdResult._proxy(_jsObject) : super._proxy(_jsObject);
+
+ /*
+ * Public accessors
+ */
+ /// The channel ID for this app to use for push messaging.
+ String get channelId => JS('String', '#.channelId', this._jsObject);
+
+ void set channelId(String channelId) {
+ JS('void', '#.channelId = #', this._jsObject, channelId);
+ }
+
+}
+
+/**
+ * Events
+ */
+
+/// Fired when a push message has been received.
+class Event_push_messaging_onMessage extends Event {
+ void addListener(void callback(PushmessagingMessage message)) {
+ void __proxy_callback(message) {
+ if (?callback) {
+ callback(new PushmessagingMessage._proxy(message));
+ }
+ }
+ super.addListener(callback);
+ }
+
+ void removeListener(void callback(PushmessagingMessage message)) {
+ void __proxy_callback(message) {
+ if (?callback) {
+ callback(new PushmessagingMessage._proxy(message));
+ }
+ }
+ super.removeListener(callback);
+ }
+
+ bool hasListener(void callback(PushmessagingMessage message)) {
+ void __proxy_callback(message) {
+ if (?callback) {
+ callback(new PushmessagingMessage._proxy(message));
+ }
+ }
+ super.hasListener(callback);
+ }
+
+ Event_push_messaging_onMessage(jsObject) : super._(jsObject, 1);
+}
+
+/**
+ * Functions
+ */
+
+class API_push_messaging {
+ /*
+ * API connection
+ */
+ Object _jsObject;
+
+ /*
+ * Events
+ */
+ Event_push_messaging_onMessage onMessage;
+
+ /*
+ * Functions
+ */
+ /// Retrieves the channel ID associated with this app or extension. Typically
+ /// an app or extension will want to send this value to its application server
+ /// so the server can use it to trigger push messages back to the app or
+ /// extension. If the interactive flag is set, we will ask the user to log in
+ /// when they are not already logged in.
+ void getChannelId(void callback(PushmessagingChannelIdResult channelId), [bool interactive]) {
+ void __proxy_callback(channelId) {
+ if (?callback) {
+ callback(new PushmessagingChannelIdResult._proxy(channelId));
+ }
+ }
+ JS('void', '#.getChannelId(#, #)', this._jsObject, interactive, convertDartClosureToJS(__proxy_callback, 1));
+ }
+
+ API_push_messaging(this._jsObject) {
+ onMessage = new Event_push_messaging_onMessage(JS('', '#.onMessage', this._jsObject));
+ }
+}
« 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