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

Unified Diff: Source/core/events/KeyboardEvent.cpp

Issue 1182313006: Populates sourceDevice attribute into KeyboardEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
Index: Source/core/events/KeyboardEvent.cpp
diff --git a/Source/core/events/KeyboardEvent.cpp b/Source/core/events/KeyboardEvent.cpp
index 164091f74af6d05f001f286422db7f42094bff5c..04d96d57228e78d249211e933e244cec22216e03 100644
--- a/Source/core/events/KeyboardEvent.cpp
+++ b/Source/core/events/KeyboardEvent.cpp
@@ -101,8 +101,7 @@ KeyboardEvent::KeyboardEvent()
}
KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view)
- : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()),
- true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
+ : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey(), InputDevice::doesntFireTouchEventsInputDevice())
, m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key)))
, m_keyIdentifier(key.keyIdentifier())
, m_code(key.code())
@@ -114,7 +113,7 @@ KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie
}
KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventInit& initializer)
- : UIEventWithKeyState(eventType, initializer.bubbles(), initializer.cancelable(), initializer.view(), initializer.detail(), initializer.ctrlKey(), initializer.altKey(), initializer.shiftKey(), initializer.metaKey())
+ : UIEventWithKeyState(eventType, initializer.bubbles(), initializer.cancelable(), initializer.view(), initializer.detail(), initializer.ctrlKey(), initializer.altKey(), initializer.shiftKey(), initializer.metaKey(), initializer.sourceDevice())
, m_keyIdentifier(initializer.keyIdentifier())
, m_location(initializer.location())
, m_isAutoRepeat(initializer.repeat())
@@ -123,7 +122,7 @@ KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI
KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView *view,
const String& keyIdentifier, const String& code, const String& key, unsigned location, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
- : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, altKey, shiftKey, metaKey)
+ : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, altKey, shiftKey, metaKey, InputDevice::doesntFireTouchEventsInputDevice())
, m_keyIdentifier(keyIdentifier)
, m_code(code)
, m_key(key)
@@ -137,7 +136,7 @@ KeyboardEvent::~KeyboardEvent()
}
void KeyboardEvent::initKeyboardEvent(ScriptState* scriptState, const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
- const String& keyIdentifier, unsigned location, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+ const String& keyIdentifier, unsigned location, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, InputDevice* sourceDevice)
{
if (dispatched())
return;
@@ -145,7 +144,7 @@ void KeyboardEvent::initKeyboardEvent(ScriptState* scriptState, const AtomicStri
if (scriptState->world().isIsolatedWorld())
UIEventWithKeyState::didCreateEventInIsolatedWorld(ctrlKey, altKey, shiftKey, metaKey);
- initUIEvent(type, canBubble, cancelable, view, 0);
+ initUIEvent(type, canBubble, cancelable, view, 0, sourceDevice);
m_keyIdentifier = keyIdentifier;
m_location = location;

Powered by Google App Engine
This is Rietveld 408576698