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

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

Issue 143363011: First pass at cleaning up html lib warnings from the analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/src/EventStreamProvider.dart ('k') | tools/dom/src/native_DOMImplementation.dart » ('j') | 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) 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 part of html; 5 part of html;
6 6
7 /** 7 /**
8 * Internal class that does the actual calculations to determine keyCode and 8 * Internal class that does the actual calculations to determine keyCode and
9 * charCode for keydown, keypress, and keyup events for all browsers. 9 * charCode for keydown, keypress, and keyup events for all browsers.
10 */ 10 */
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 var handler = new _KeyboardEventHandler.initializeAllEventListeners( 69 var handler = new _KeyboardEventHandler.initializeAllEventListeners(
70 _type, e); 70 _type, e);
71 return handler._stream; 71 return handler._stream;
72 } 72 }
73 73
74 /** 74 /**
75 * General constructor, performs basic initialization for our improved 75 * General constructor, performs basic initialization for our improved
76 * KeyboardEvent controller. 76 * KeyboardEvent controller.
77 */ 77 */
78 _KeyboardEventHandler(this._type): super(_EVENT_TYPE), 78 _KeyboardEventHandler(this._type): super(_EVENT_TYPE),
79 _stream = new _CustomKeyEventStreamImpl('event'); 79 _stream = new _CustomKeyEventStreamImpl('event'), _target = null;
80 80
81 /** 81 /**
82 * Hook up all event listeners under the covers so we can estimate keycodes 82 * Hook up all event listeners under the covers so we can estimate keycodes
83 * and charcodes when they are not provided. 83 * and charcodes when they are not provided.
84 */ 84 */
85 _KeyboardEventHandler.initializeAllEventListeners(this._type, this._target) : 85 _KeyboardEventHandler.initializeAllEventListeners(this._type, this._target) :
86 super(_EVENT_TYPE) { 86 super(_EVENT_TYPE) {
87 Element.keyDownEvent.forTarget(_target, useCapture: true).listen( 87 Element.keyDownEvent.forTarget(_target, useCapture: true).listen(
88 processKeyDown); 88 processKeyDown);
89 Element.keyPressEvent.forTarget(_target, useCapture: true).listen( 89 Element.keyPressEvent.forTarget(_target, useCapture: true).listen(
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 new _KeyboardEventHandler('keypress').forTarget(target); 372 new _KeyboardEventHandler('keypress').forTarget(target);
373 373
374 /** Named constructor to produce a stream for onKeyUp events. */ 374 /** Named constructor to produce a stream for onKeyUp events. */
375 static CustomStream<KeyEvent> onKeyUp(EventTarget target) => 375 static CustomStream<KeyEvent> onKeyUp(EventTarget target) =>
376 new _KeyboardEventHandler('keyup').forTarget(target); 376 new _KeyboardEventHandler('keyup').forTarget(target);
377 377
378 /** Named constructor to produce a stream for onKeyDown events. */ 378 /** Named constructor to produce a stream for onKeyDown events. */
379 static CustomStream<KeyEvent> onKeyDown(EventTarget target) => 379 static CustomStream<KeyEvent> onKeyDown(EventTarget target) =>
380 new _KeyboardEventHandler('keydown').forTarget(target); 380 new _KeyboardEventHandler('keydown').forTarget(target);
381 } 381 }
OLDNEW
« no previous file with comments | « tools/dom/src/EventStreamProvider.dart ('k') | tools/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698