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

Unified Diff: tools/dom/src/dartium_KeyEvent.dart

Issue 26247006: Fix KeyEvent (factory) constructor in Dartium. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/dartium_KeyEvent.dart
diff --git a/tools/dom/src/dartium_KeyEvent.dart b/tools/dom/src/dartium_KeyEvent.dart
index 1adf7d888599b4ba97d92a07a06d893edd3531bb..3b39bdb70e40e73c8fbd742ea5b760f90aa991df 100644
--- a/tools/dom/src/dartium_KeyEvent.dart
+++ b/tools/dom/src/dartium_KeyEvent.dart
@@ -61,19 +61,21 @@ class KeyEvent extends _WrappedEvent implements KeyboardEvent {
}
/** Programmatically create a new KeyEvent (and KeyboardEvent). */
- KeyEvent(String type,
+ factory KeyEvent(String type,
{Window view, bool canBubble: true, bool cancelable: true, int keyCode: 0,
int charCode: 0, int keyLocation: 1, bool ctrlKey: false,
bool altKey: false, bool shiftKey: false, bool metaKey: false,
bool altGraphKey: false, EventTarget currentTarget}) {
- _parent = new KeyboardEvent(type, view: view, canBubble: canBubble,
+ var parent = new KeyboardEvent(type, view: view, canBubble: canBubble,
cancelable: cancelable, keyLocation: keyLocation, ctrlKey: ctrlKey,
altKey: altKey, shiftKey: shiftKey, metaKey: metaKey, altGraphKey:
altGraphKey);
- _shadowAltKey = altKey;
- _shadowCharCode = charCode;
- _shadowKeyCode = keyCode;
- _currentTarget = currentTarget == null ? window : currentTarget;
+ var keyEvent = KeyEvent.wrap(parent);
+ keyEvent._shadowAltKey = altKey;
+ keyEvent._shadowCharCode = charCode;
+ keyEvent._shadowKeyCode = keyCode;
+ keyEvent._currentTarget = currentTarget == null ? window : currentTarget;
+ return keyEvent;
}
/** Accessor to provide a stream of KeyEvents on the desired target. */
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698