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 } | 18 } |
19 | 19 |
20 PassRefPtrWillBeRawPtr<EventDispatchMediator> InputEvent::createMediator() | |
21 { | |
22 return InputEventDispatchMediator::create(this); | |
23 } | |
24 | |
25 bool InputEvent::isInputEvent() const | 20 bool InputEvent::isInputEvent() const |
26 { | 21 { |
27 return true; | 22 return true; |
28 } | 23 } |
29 | 24 |
30 DEFINE_TRACE(InputEvent) | 25 DEFINE_TRACE(InputEvent) |
31 { | 26 { |
32 UIEvent::trace(visitor); | 27 UIEvent::trace(visitor); |
33 } | 28 } |
34 | 29 |
35 PassRefPtrWillBeRawPtr<InputEventDispatchMediator> InputEventDispatchMediator::c
reate(PassRefPtrWillBeRawPtr<InputEvent> inputEvent) | |
36 { | |
37 return adoptRefWillBeNoop(new InputEventDispatchMediator(inputEvent)); | |
38 } | |
39 | |
40 InputEventDispatchMediator::InputEventDispatchMediator(PassRefPtrWillBeRawPtr<In
putEvent> inputEvent) | |
41 : EventDispatchMediator(inputEvent) | |
42 { | |
43 } | |
44 | |
45 InputEvent& InputEventDispatchMediator::event() const | |
46 { | |
47 return toInputEvent(EventDispatchMediator::event()); | |
48 } | |
49 | |
50 bool InputEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons
t | |
51 { | |
52 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH
andled(); | |
53 } | |
54 | |
55 } // namespace blink | 30 } // namespace blink |
OLD | NEW |