| 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 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 |
| 19 static InputDevice* create(bool firesTouchEvents) | 23 static InputDevice* create(bool firesTouchEvents) |
| 20 { | 24 { |
| 21 return new InputDevice(firesTouchEvents); | 25 return new InputDevice(firesTouchEvents); |
| 22 } | 26 } |
| 23 | 27 |
| 24 static InputDevice* create( | 28 static InputDevice* create( |
| 25 const InputDeviceInit& initializer) | 29 const InputDeviceInit& initializer) |
| 26 { | 30 { |
| 27 return new InputDevice(initializer); | 31 return new InputDevice(initializer); |
| 28 } | 32 } |
| 29 | 33 |
| 30 bool firesTouchEvents() const { return m_firesTouchEvents; } | 34 bool firesTouchEvents() const { return m_firesTouchEvents; } |
| 31 | 35 |
| 32 DEFINE_INLINE_TRACE() { } | 36 DEFINE_INLINE_TRACE() { } |
| 33 | 37 |
| 34 private: | 38 private: |
| 35 InputDevice(bool firesTouchEvents); | 39 InputDevice(bool firesTouchEvents); |
| 36 InputDevice(const InputDeviceInit&); | 40 InputDevice(const InputDeviceInit&); |
| 37 | 41 |
| 38 // Whether this device dispatches touch events. This mainly lets developers | 42 // Whether this device dispatches touch events. This mainly lets developers |
| 39 // avoid handling both touch and mouse events dispatched for a single user | 43 // avoid handling both touch and mouse events dispatched for a single user |
| 40 // action. | 44 // action. |
| 41 bool m_firesTouchEvents; | 45 bool m_firesTouchEvents; |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 } // namespace blink | 48 } // namespace blink |
| 45 | 49 |
| 46 #endif // InputDevice_h | 50 #endif // InputDevice_h |
| OLD | NEW |