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

Side by Side Diff: tools/dom/src/EventStreamProvider.dart

Issue 2885103005: Add dart:html and friends to patched_dart2js_sdk/platform.dill, also fix up (Closed)
Patch Set: v1 Created 3 years, 7 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
« no previous file with comments | « sdk/lib/html/html_common/css_class_set.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 part of html; 5 part of html;
6 6
7 /** 7 /**
8 * A factory to expose DOM events as Streams. 8 * A factory to expose DOM events as Streams.
9 */ 9 */
10 class EventStreamProvider<T extends Event> { 10 class EventStreamProvider<T extends Event> {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 _target.addEventListener(_eventType, _onData, _useCapture); 291 _target.addEventListener(_eventType, _onData, _useCapture);
292 } 292 }
293 } 293 }
294 294
295 void _unlisten() { 295 void _unlisten() {
296 if (_onData != null) { 296 if (_onData != null) {
297 _target.removeEventListener(_eventType, _onData, _useCapture); 297 _target.removeEventListener(_eventType, _onData, _useCapture);
298 } 298 }
299 } 299 }
300 300
301 Future/*<E>*/ asFuture/*<E>*/([var/*=E*/ futureValue]) { 301 Future<E> asFuture<E>([E futureValue]) {
302 // We just need a future that will never succeed or fail. 302 // We just need a future that will never succeed or fail.
303 var completer = new Completer/*<E>*/(); 303 var completer = new Completer<E>();
304 return completer.future; 304 return completer.future;
305 } 305 }
306 } 306 }
307 307
308 /** 308 /**
309 * A stream of custom events, which enables the user to "fire" (add) their own 309 * A stream of custom events, which enables the user to "fire" (add) their own
310 * custom events to a stream. 310 * custom events to a stream.
311 */ 311 */
312 abstract class CustomStream<T extends Event> implements Stream<T> { 312 abstract class CustomStream<T extends Event> implements Stream<T> {
313 /** 313 /**
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 e, _eventTypeGetter(e), useCapture); 438 e, _eventTypeGetter(e), useCapture);
439 } 439 }
440 440
441 String getEventType(EventTarget target) { 441 String getEventType(EventTarget target) {
442 return _eventTypeGetter(target); 442 return _eventTypeGetter(target);
443 } 443 }
444 444
445 String get _eventType => 445 String get _eventType =>
446 throw new UnsupportedError('Access type through getEventType method.'); 446 throw new UnsupportedError('Access type through getEventType method.');
447 } 447 }
OLDNEW
« no previous file with comments | « sdk/lib/html/html_common/css_class_set.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698