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

Side by Side Diff: Source/core/input/InputDevice.h

Issue 1161783006: Populates sourceDevice attribute into TouchEvent (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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef InputDevice_h
6 #define InputDevice_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/CoreExport.h"
10 #include "core/input/InputDeviceInit.h"
11 #include "wtf/PassRefPtr.h"
12 #include "wtf/RefCounted.h"
13
14 namespace blink {
15
16 class CORE_EXPORT InputDevice : public RefCountedWillBeGarbageCollectedFinalized <InputDevice>, public ScriptWrappable {
17 DEFINE_WRAPPERTYPEINFO();
18
19 public:
20 ~InputDevice();
21
22 // This return a static local InputDevice pointer which has firesTouchEvents set to be true.
23 static PassRefPtrWillBeRawPtr<InputDevice> touchEventInstance();
24
25 // This return a static local InputDevice pointer which has firesTouchEvents set to be false.
26 static PassRefPtrWillBeRawPtr<InputDevice> nonTouchEventInstance();
27
28 static PassRefPtrWillBeRawPtr<InputDevice> create()
29 {
30 return adoptRefWillBeNoop(new InputDevice);
31 }
32
33 static PassRefPtrWillBeRawPtr<InputDevice> create(bool firesTouchEvents)
34 {
35 return adoptRefWillBeNoop(new InputDevice(firesTouchEvents));
36 }
37
38 static PassRefPtrWillBeRawPtr<InputDevice> create(
39 const InputDeviceInit& initializer)
40 {
41 return adoptRefWillBeNoop(new InputDevice(initializer));
42 }
43
44 bool firesTouchEvents() const { return m_firesTouchEvents; }
45 void setFiresTouchEvents(bool firesTouchEvents)
46 {
47 m_firesTouchEvents = firesTouchEvents;
48 }
49
50 DECLARE_VIRTUAL_TRACE();
51
52 private:
53 InputDevice();
54 InputDevice(bool);
55 InputDevice(const InputDeviceInit&);
56
57 // Whether this device dispatches touch events. This mainly lets developers
58 // avoid handling both touch and mouse events dispatched for a single user
59 // action.
60 bool m_firesTouchEvents;
61 };
62
63 } // namespace blink
64
65 #endif // InputDevice_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698