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

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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef InputDevice_h 5 #ifndef InputDevice_h
6 #define InputDevice_h 6 #define InputDevice_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/CoreExport.h" 9 #include "core/CoreExport.h"
10 #include "core/input/InputDeviceInit.h" 10 #include "core/input/InputDeviceInit.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class CORE_EXPORT InputDevice : public GarbageCollectedFinalized<InputDevice>, p ublic ScriptWrappable { 14 class CORE_EXPORT InputDevice : public GarbageCollectedFinalized<InputDevice>, p ublic ScriptWrappable {
15 DEFINE_WRAPPERTYPEINFO(); 15 DEFINE_WRAPPERTYPEINFO();
16 16
17 public: 17 public:
18 ~InputDevice(); 18 ~InputDevice();
19
20 // This return a static local InputDevice pointer which has firesTouchEvents set to be true.
21 static InputDevice* touchEventInstance();
22
23 // This return a static local InputDevice pointer which has firesTouchEvents set to be false.
24 static InputDevice* nonTouchEventInstance();
tdresser 2015/06/10 13:46:00 Let's remove this until we use it.
lanwei 2015/06/10 23:23:22 Done.
25
19 static InputDevice* create(bool firesTouchEvents) 26 static InputDevice* create(bool firesTouchEvents)
20 { 27 {
21 return new InputDevice(firesTouchEvents); 28 return new InputDevice(firesTouchEvents);
22 } 29 }
23 30
24 static InputDevice* create( 31 static InputDevice* create(
25 const InputDeviceInit& initializer) 32 const InputDeviceInit& initializer)
26 { 33 {
27 return new InputDevice(initializer); 34 return new InputDevice(initializer);
28 } 35 }
29 36
30 bool firesTouchEvents() const { return m_firesTouchEvents; } 37 bool firesTouchEvents() const { return m_firesTouchEvents; }
31 38
32 DEFINE_INLINE_TRACE() { } 39 DEFINE_INLINE_TRACE() { }
33 40
34 private: 41 private:
35 InputDevice(bool firesTouchEvents); 42 InputDevice(bool firesTouchEvents);
36 InputDevice(const InputDeviceInit&); 43 InputDevice(const InputDeviceInit&);
37 44
38 // Whether this device dispatches touch events. This mainly lets developers 45 // Whether this device dispatches touch events. This mainly lets developers
39 // avoid handling both touch and mouse events dispatched for a single user 46 // avoid handling both touch and mouse events dispatched for a single user
40 // action. 47 // action.
41 bool m_firesTouchEvents; 48 bool m_firesTouchEvents;
42 }; 49 };
43 50
44 } // namespace blink 51 } // namespace blink
45 52
46 #endif // InputDevice_h 53 #endif // InputDevice_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698