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

Side by Side Diff: Source/core/events/KeyboardEvent.cpp

Issue 933323002: Add experimental Support for DOM3 KeyboardEvent key value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added key=value pair for screencastview.js Created 5 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
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 , m_isAutoRepeat(false) 90 , m_isAutoRepeat(false)
91 { 91 {
92 } 92 }
93 93
94 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie w) 94 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie w)
95 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), 95 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()),
96 true, true, view, 0, key.ctrlKey(), key.altKey(), key. shiftKey(), key.metaKey()) 96 true, true, view, 0, key.ctrlKey(), key.altKey(), key. shiftKey(), key.metaKey())
97 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) 97 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key)))
98 , m_keyIdentifier(key.keyIdentifier()) 98 , m_keyIdentifier(key.keyIdentifier())
99 , m_code(key.code()) 99 , m_code(key.code())
100 , m_key(key.key())
100 , m_location(keyLocationCode(key)) 101 , m_location(keyLocationCode(key))
101 , m_isAutoRepeat(key.isAutoRepeat()) 102 , m_isAutoRepeat(key.isAutoRepeat())
Wez 2015/03/04 23:00:25 Not specific to this CL but perhaps rbyers@ can co
102 { 103 {
103 setUICreateTime(key.timestamp()); 104 setUICreateTime(key.timestamp());
104 } 105 }
105 106
106 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI nit& initializer) 107 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI nit& initializer)
107 : UIEventWithKeyState(eventType, initializer.bubbles(), initializer.cancelab le(), initializer.view(), initializer.detail(), initializer.ctrlKey(), initializ er.altKey(), initializer.shiftKey(), initializer.metaKey()) 108 : UIEventWithKeyState(eventType, initializer.bubbles(), initializer.cancelab le(), initializer.view(), initializer.detail(), initializer.ctrlKey(), initializ er.altKey(), initializer.shiftKey(), initializer.metaKey())
108 , m_keyIdentifier(initializer.keyIdentifier()) 109 , m_keyIdentifier(initializer.keyIdentifier())
109 , m_location(initializer.location()) 110 , m_location(initializer.location())
110 , m_isAutoRepeat(initializer.repeat()) 111 , m_isAutoRepeat(initializer.repeat())
111 { 112 {
112 } 113 }
113 114
114 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView *view, 115 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView *view,
115 const String& keyIdentifier, const String& code, unsigned location, bool ctr lKey, bool altKey, bool shiftKey, bool metaKey) 116 const String& keyIdentifier, const String& code, const String& key, unsigned location, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
116 : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, al tKey, shiftKey, metaKey) 117 : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, al tKey, shiftKey, metaKey)
117 , m_keyIdentifier(keyIdentifier) 118 , m_keyIdentifier(keyIdentifier)
118 , m_code(code) 119 , m_code(code)
120 , m_key(key)
119 , m_location(location) 121 , m_location(location)
120 , m_isAutoRepeat(false) 122 , m_isAutoRepeat(false)
121 { 123 {
122 } 124 }
123 125
124 KeyboardEvent::~KeyboardEvent() 126 KeyboardEvent::~KeyboardEvent()
125 { 127 {
126 } 128 }
127 129
128 void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, 130 void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 { 223 {
222 } 224 }
223 225
224 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c onst 226 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c onst
225 { 227 {
226 // Make sure not to return true if we already took default action while hand ling the event. 228 // Make sure not to return true if we already took default action while hand ling the event.
227 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled(); 229 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled();
228 } 230 }
229 231
230 } // namespace blink 232 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698