| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library android_extension; | 5 library android_extension; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 | 7 |
| 8 // A VERY simplified DOM. | 8 // A VERY simplified DOM. |
| 9 | 9 |
| 10 class BodyElement { | 10 class BodyElement { |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 if (_onData != null && !_paused) { | 248 if (_onData != null && !_paused) { |
| 249 _target.addListener(_eventType, _onData); | 249 _target.addListener(_eventType, _onData); |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 | 252 |
| 253 void _unlisten() { | 253 void _unlisten() { |
| 254 if (_onData != null) { | 254 if (_onData != null) { |
| 255 _target.removeListener(_eventType, _onData); | 255 _target.removeListener(_eventType, _onData); |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 |
| 259 Future asFuture([var futureValue]) { |
| 260 // We just need a future that will never succeed or fail. |
| 261 Completer completer = new Completer(); |
| 262 return completer.future; |
| 263 } |
| 258 } | 264 } |
| 259 | 265 |
| 260 class _EventStream<T extends Event> extends Stream<T> { | 266 class _EventStream<T extends Event> extends Stream<T> { |
| 261 final Object _target; | 267 final Object _target; |
| 262 final String _eventType; | 268 final String _eventType; |
| 263 | 269 |
| 264 _EventStream(this._target, this._eventType); | 270 _EventStream(this._target, this._eventType); |
| 265 | 271 |
| 266 // DOM events are inherently multi-subscribers. | 272 // DOM events are inherently multi-subscribers. |
| 267 Stream<T> asBroadcastStream() => this; | 273 Stream<T> asBroadcastStream() => this; |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 | 1202 |
| 1197 // TODO(vsm): Kill. | 1203 // TODO(vsm): Kill. |
| 1198 noSuchMethod(invocation) { | 1204 noSuchMethod(invocation) { |
| 1199 throw new Exception('Unimplemented/unknown ${invocation.memberName}'); | 1205 throw new Exception('Unimplemented/unknown ${invocation.memberName}'); |
| 1200 } | 1206 } |
| 1201 } | 1207 } |
| 1202 | 1208 |
| 1203 var sfx_extension = 'raw'; | 1209 var sfx_extension = 'raw'; |
| 1204 int _loadSample(String s) native "LoadSample"; | 1210 int _loadSample(String s) native "LoadSample"; |
| 1205 int _playSample(String s) native "PlaySample"; | 1211 int _playSample(String s) native "PlaySample"; |
| OLD | NEW |