| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Generated from namespace: app.runtime | 5 // Generated from namespace: app.runtime |
| 6 | 6 |
| 7 part of chrome; | 7 part of chrome; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Types | 10 * Types |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 /// Callback to be compatible with WebIntents. | 50 /// Callback to be compatible with WebIntents. |
| 51 void postFailure() => JS('void', '#.postFailure()', this._jsObject); | 51 void postFailure() => JS('void', '#.postFailure()', this._jsObject); |
| 52 | 52 |
| 53 } | 53 } |
| 54 | 54 |
| 55 class AppRuntimeLaunchItem extends ChromeObject { | 55 class AppRuntimeLaunchItem extends ChromeObject { |
| 56 /* | 56 /* |
| 57 * Public constructor | 57 * Public constructor |
| 58 */ | 58 */ |
| 59 AppRuntimeLaunchItem({FileEntry entry, String type}) { | 59 AppRuntimeLaunchItem({FileEntry entry, String type}) { |
| 60 if (?entry) | 60 if (entry != null) |
| 61 this.entry = entry; | 61 this.entry = entry; |
| 62 if (?type) | 62 if (type != null) |
| 63 this.type = type; | 63 this.type = type; |
| 64 } | 64 } |
| 65 | 65 |
| 66 /* | 66 /* |
| 67 * Private constructor | 67 * Private constructor |
| 68 */ | 68 */ |
| 69 AppRuntimeLaunchItem._proxy(_jsObject) : super._proxy(_jsObject); | 69 AppRuntimeLaunchItem._proxy(_jsObject) : super._proxy(_jsObject); |
| 70 | 70 |
| 71 /* | 71 /* |
| 72 * Public accessors | 72 * Public accessors |
| (...skipping 12 matching lines...) Expand all Loading... |
| 85 JS('void', '#.type = #', this._jsObject, type); | 85 JS('void', '#.type = #', this._jsObject, type); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } | 88 } |
| 89 | 89 |
| 90 class AppRuntimeLaunchData extends ChromeObject { | 90 class AppRuntimeLaunchData extends ChromeObject { |
| 91 /* | 91 /* |
| 92 * Public constructor | 92 * Public constructor |
| 93 */ | 93 */ |
| 94 AppRuntimeLaunchData({AppRuntimeIntent intent, String id, List<AppRuntimeLaunc
hItem> items}) { | 94 AppRuntimeLaunchData({AppRuntimeIntent intent, String id, List<AppRuntimeLaunc
hItem> items}) { |
| 95 if (?intent) | 95 if (intent != null) |
| 96 this.intent = intent; | 96 this.intent = intent; |
| 97 if (?id) | 97 if (id != null) |
| 98 this.id = id; | 98 this.id = id; |
| 99 if (?items) | 99 if (items != null) |
| 100 this.items = items; | 100 this.items = items; |
| 101 } | 101 } |
| 102 | 102 |
| 103 /* | 103 /* |
| 104 * Private constructor | 104 * Private constructor |
| 105 */ | 105 */ |
| 106 AppRuntimeLaunchData._proxy(_jsObject) : super._proxy(_jsObject); | 106 AppRuntimeLaunchData._proxy(_jsObject) : super._proxy(_jsObject); |
| 107 | 107 |
| 108 /* | 108 /* |
| 109 * Public accessors | 109 * Public accessors |
| (...skipping 23 matching lines...) Expand all Loading... |
| 133 JS('void', '#.items = #', this._jsObject, convertArgument(items)); | 133 JS('void', '#.items = #', this._jsObject, convertArgument(items)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } | 136 } |
| 137 | 137 |
| 138 class AppRuntimeIntentResponse extends ChromeObject { | 138 class AppRuntimeIntentResponse extends ChromeObject { |
| 139 /* | 139 /* |
| 140 * Public constructor | 140 * Public constructor |
| 141 */ | 141 */ |
| 142 AppRuntimeIntentResponse({int intentId, bool success, Object data}) { | 142 AppRuntimeIntentResponse({int intentId, bool success, Object data}) { |
| 143 if (?intentId) | 143 if (intentId != null) |
| 144 this.intentId = intentId; | 144 this.intentId = intentId; |
| 145 if (?success) | 145 if (success != null) |
| 146 this.success = success; | 146 this.success = success; |
| 147 if (?data) | 147 if (data != null) |
| 148 this.data = data; | 148 this.data = data; |
| 149 } | 149 } |
| 150 | 150 |
| 151 /* | 151 /* |
| 152 * Private constructor | 152 * Private constructor |
| 153 */ | 153 */ |
| 154 AppRuntimeIntentResponse._proxy(_jsObject) : super._proxy(_jsObject); | 154 AppRuntimeIntentResponse._proxy(_jsObject) : super._proxy(_jsObject); |
| 155 | 155 |
| 156 /* | 156 /* |
| 157 * Public accessors | 157 * Public accessors |
| (...skipping 23 matching lines...) Expand all Loading... |
| 181 | 181 |
| 182 /** | 182 /** |
| 183 * Events | 183 * Events |
| 184 */ | 184 */ |
| 185 | 185 |
| 186 /// Fired when an app is launched from the launcher or in response to a web | 186 /// Fired when an app is launched from the launcher or in response to a web |
| 187 /// intent. | 187 /// intent. |
| 188 class Event_app_runtime_onLaunched extends Event { | 188 class Event_app_runtime_onLaunched extends Event { |
| 189 void addListener(void callback(AppRuntimeLaunchData launchData)) { | 189 void addListener(void callback(AppRuntimeLaunchData launchData)) { |
| 190 void __proxy_callback(launchData) { | 190 void __proxy_callback(launchData) { |
| 191 if (?callback) { | 191 if (callback != null) { |
| 192 callback(new AppRuntimeLaunchData._proxy(launchData)); | 192 callback(new AppRuntimeLaunchData._proxy(launchData)); |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 super.addListener(callback); | 195 super.addListener(callback); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void removeListener(void callback(AppRuntimeLaunchData launchData)) { | 198 void removeListener(void callback(AppRuntimeLaunchData launchData)) { |
| 199 void __proxy_callback(launchData) { | 199 void __proxy_callback(launchData) { |
| 200 if (?callback) { | 200 if (callback != null) { |
| 201 callback(new AppRuntimeLaunchData._proxy(launchData)); | 201 callback(new AppRuntimeLaunchData._proxy(launchData)); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 super.removeListener(callback); | 204 super.removeListener(callback); |
| 205 } | 205 } |
| 206 | 206 |
| 207 bool hasListener(void callback(AppRuntimeLaunchData launchData)) { | 207 bool hasListener(void callback(AppRuntimeLaunchData launchData)) { |
| 208 void __proxy_callback(launchData) { | 208 void __proxy_callback(launchData) { |
| 209 if (?callback) { | 209 if (callback != null) { |
| 210 callback(new AppRuntimeLaunchData._proxy(launchData)); | 210 callback(new AppRuntimeLaunchData._proxy(launchData)); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 super.hasListener(callback); | 213 super.hasListener(callback); |
| 214 } | 214 } |
| 215 | 215 |
| 216 Event_app_runtime_onLaunched(jsObject) : super._(jsObject, 1); | 216 Event_app_runtime_onLaunched(jsObject) : super._(jsObject, 1); |
| 217 } | 217 } |
| 218 | 218 |
| 219 /// Fired at Chrome startup to apps that were running when Chrome last shut | 219 /// Fired at Chrome startup to apps that were running when Chrome last shut |
| (...skipping 30 matching lines...) Expand all Loading... |
| 250 /// postIntentResponse is an internal method to responds to an intent | 250 /// postIntentResponse is an internal method to responds to an intent |
| 251 /// previously sent to a packaged app. This is identified by intentId, and | 251 /// previously sent to a packaged app. This is identified by intentId, and |
| 252 /// should only be invoked at most once per intentId. | 252 /// should only be invoked at most once per intentId. |
| 253 void postIntentResponse(AppRuntimeIntentResponse intentResponse) => JS('void',
'#.postIntentResponse(#)', this._jsObject, convertArgument(intentResponse)); | 253 void postIntentResponse(AppRuntimeIntentResponse intentResponse) => JS('void',
'#.postIntentResponse(#)', this._jsObject, convertArgument(intentResponse)); |
| 254 | 254 |
| 255 API_app_runtime(this._jsObject) { | 255 API_app_runtime(this._jsObject) { |
| 256 onLaunched = new Event_app_runtime_onLaunched(JS('', '#.onLaunched', this._j
sObject)); | 256 onLaunched = new Event_app_runtime_onLaunched(JS('', '#.onLaunched', this._j
sObject)); |
| 257 onRestarted = new Event_app_runtime_onRestarted(JS('', '#.onRestarted', this
._jsObject)); | 257 onRestarted = new Event_app_runtime_onRestarted(JS('', '#.onRestarted', this
._jsObject)); |
| 258 } | 258 } |
| 259 } | 259 } |
| OLD | NEW |