Chromium Code Reviews| 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 class _EventsImpl implements Events { | 5 class _EventsImpl implements Events { |
| 6 /* Raw event target. */ | 6 /* Raw event target. */ |
| 7 // TODO(jacobr): it would be nice if we could specify this as | 7 // TODO(jacobr): it would be nice if we could specify this as |
| 8 // _EventTargetImpl or EventTarget | 8 // _EventTargetImpl or EventTarget |
| 9 final Dynamic _ptr; | 9 final Dynamic _ptr; |
| 10 | 10 |
| 11 _EventsImpl(this._ptr); | 11 _EventsImpl(this._ptr); |
| 12 | 12 |
| 13 _EventListenerListImpl operator [](String type) => _get(type.toLowerCase()); | 13 _EventListenerListImpl operator [](String type) { |
|
Anton Muhin
2012/06/05 13:47:03
=> syntax?
| |
| 14 | |
| 15 _EventListenerListImpl _get(String type) { | |
| 16 return new _EventListenerListImpl(_ptr, type); | 14 return new _EventListenerListImpl(_ptr, type); |
| 17 } | 15 } |
| 18 } | 16 } |
| 19 | 17 |
| 20 class _EventListenerListImpl implements EventListenerList { | 18 class _EventListenerListImpl implements EventListenerList { |
| 21 | 19 |
| 22 // TODO(jacobr): make this _EventTargetImpl | 20 // TODO(jacobr): make this _EventTargetImpl |
| 23 final Dynamic _ptr; | 21 final Dynamic _ptr; |
| 24 final String _type; | 22 final String _type; |
| 25 | 23 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 54 _ptr.$dom_removeEventListener(_type, listener, useCapture); | 52 _ptr.$dom_removeEventListener(_type, listener, useCapture); |
| 55 } | 53 } |
| 56 } | 54 } |
| 57 | 55 |
| 58 | 56 |
| 59 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 57 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 60 | 58 |
| 61 Events get on() => new _EventsImpl(this); | 59 Events get on() => new _EventsImpl(this); |
| 62 $!MEMBERS | 60 $!MEMBERS |
| 63 } | 61 } |
| OLD | NEW |