OLD | NEW |
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 InputDeviceCapabilities_h | 5 #ifndef InputDeviceCapabilities_h |
6 #define InputDeviceCapabilities_h | 6 #define InputDeviceCapabilities_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/InputDeviceCapabilitiesInit.h" | 10 #include "core/input/InputDeviceCapabilitiesInit.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class CORE_EXPORT InputDeviceCapabilities final | 14 class CORE_EXPORT InputDeviceCapabilities final |
15 : public GarbageCollected<InputDeviceCapabilities>, | 15 : public GarbageCollected<InputDeviceCapabilities>, |
16 public ScriptWrappable { | 16 public ScriptWrappable { |
17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
18 | 18 |
19 public: | 19 public: |
20 // This return a static local InputDeviceCapabilities pointer which has firesT
ouchEvents set to be true. | 20 // This return a static local InputDeviceCapabilities pointer which has |
| 21 // firesTouchEvents set to be true. |
21 static InputDeviceCapabilities* firesTouchEventsSourceCapabilities(); | 22 static InputDeviceCapabilities* firesTouchEventsSourceCapabilities(); |
22 | 23 |
23 // This return a static local InputDeviceCapabilities pointer which has firesT
ouchEvents set to be false. | 24 // This return a static local InputDeviceCapabilities pointer which has |
| 25 // firesTouchEvents set to be false. |
24 static InputDeviceCapabilities* doesntFireTouchEventsSourceCapabilities(); | 26 static InputDeviceCapabilities* doesntFireTouchEventsSourceCapabilities(); |
25 | 27 |
26 static InputDeviceCapabilities* create(bool firesTouchEvents) { | 28 static InputDeviceCapabilities* create(bool firesTouchEvents) { |
27 return new InputDeviceCapabilities(firesTouchEvents); | 29 return new InputDeviceCapabilities(firesTouchEvents); |
28 } | 30 } |
29 | 31 |
30 static InputDeviceCapabilities* create( | 32 static InputDeviceCapabilities* create( |
31 const InputDeviceCapabilitiesInit& initializer) { | 33 const InputDeviceCapabilitiesInit& initializer) { |
32 return new InputDeviceCapabilities(initializer); | 34 return new InputDeviceCapabilities(initializer); |
33 } | 35 } |
34 | 36 |
35 bool firesTouchEvents() const { return m_firesTouchEvents; } | 37 bool firesTouchEvents() const { return m_firesTouchEvents; } |
36 | 38 |
37 DEFINE_INLINE_TRACE() {} | 39 DEFINE_INLINE_TRACE() {} |
38 | 40 |
39 private: | 41 private: |
40 InputDeviceCapabilities(bool firesTouchEvents); | 42 InputDeviceCapabilities(bool firesTouchEvents); |
41 InputDeviceCapabilities(const InputDeviceCapabilitiesInit&); | 43 InputDeviceCapabilities(const InputDeviceCapabilitiesInit&); |
42 | 44 |
43 // Whether this device dispatches touch events. This mainly lets developers | 45 // Whether this device dispatches touch events. This mainly lets developers |
44 // 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 |
45 // action. | 47 // action. |
46 bool m_firesTouchEvents; | 48 bool m_firesTouchEvents; |
47 }; | 49 }; |
48 | 50 |
49 } // namespace blink | 51 } // namespace blink |
50 | 52 |
51 #endif // InputDeviceCapabilities_h | 53 #endif // InputDeviceCapabilities_h |
OLD | NEW |