| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/events/InputEvent.h" | 5 #include "core/events/InputEvent.h" |
| 6 | 6 |
| 7 #include "core/events/EventDispatcher.h" | 7 #include "core/events/EventDispatcher.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 InputEvent::InputEvent() | 11 InputEvent::InputEvent() |
| 12 { | 12 { |
| 13 } | 13 } |
| 14 | 14 |
| 15 InputEvent::InputEvent(const AtomicString& type, const InputEventInit& initializ
er) | 15 InputEvent::InputEvent(const AtomicString& type, const InputEventInit& initializ
er) |
| 16 : UIEvent(type, initializer) | 16 : UIEvent(type, initializer) |
| 17 { | 17 { |
| 18 if (initializer.hasInputType()) |
| 19 m_inputType = initializer.inputType(); |
| 20 if (initializer.hasData()) |
| 21 m_data = initializer.data(); |
| 22 } |
| 23 |
| 24 /* static */ |
| 25 PassRefPtrWillBeRawPtr<InputEvent> InputEvent::createBeforeInput(const AtomicStr
ing& inputType, const String& data) |
| 26 { |
| 27 InputEventInit inputEventInit; |
| 28 |
| 29 inputEventInit.setBubbles(true); |
| 30 inputEventInit.setInputType(inputType); |
| 31 inputEventInit.setData(data); |
| 32 |
| 33 return InputEvent::create(EventTypeNames::beforeinput, inputEventInit); |
| 18 } | 34 } |
| 19 | 35 |
| 20 bool InputEvent::isInputEvent() const | 36 bool InputEvent::isInputEvent() const |
| 21 { | 37 { |
| 22 return true; | 38 return true; |
| 23 } | 39 } |
| 24 | 40 |
| 25 DEFINE_TRACE(InputEvent) | 41 DEFINE_TRACE(InputEvent) |
| 26 { | 42 { |
| 27 UIEvent::trace(visitor); | 43 UIEvent::trace(visitor); |
| 28 } | 44 } |
| 29 | 45 |
| 30 } // namespace blink | 46 } // namespace blink |
| OLD | NEW |