Chromium Code Reviews| 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 | 19 |
| 20 // This return a static local InputDevice pointer which has firesTouchEvents set to be true. | 20 // This return a static local InputDevice pointer which has firesTouchEvents set to be true. |
| 21 static InputDevice* touchEventInstance(); | 21 static InputDevice* firesTouchEventsInputDevice(); |
| 22 | |
| 23 static InputDevice* doesntFireTouchEventsInputDevice(); | |
|
Rick Byers
2015/06/25 17:12:30
This change is also in your MouseEvent CL, right?
| |
| 22 | 24 |
| 23 static InputDevice* create(bool firesTouchEvents) | 25 static InputDevice* create(bool firesTouchEvents) |
| 24 { | 26 { |
| 25 return new InputDevice(firesTouchEvents); | 27 return new InputDevice(firesTouchEvents); |
| 26 } | 28 } |
| 27 | 29 |
| 28 static InputDevice* create( | 30 static InputDevice* create( |
| 29 const InputDeviceInit& initializer) | 31 const InputDeviceInit& initializer) |
| 30 { | 32 { |
| 31 return new InputDevice(initializer); | 33 return new InputDevice(initializer); |
| 32 } | 34 } |
| 33 | 35 |
| 34 bool firesTouchEvents() const { return m_firesTouchEvents; } | 36 bool firesTouchEvents() const { return m_firesTouchEvents; } |
| 35 | 37 |
| 36 DEFINE_INLINE_TRACE() { } | 38 DEFINE_INLINE_TRACE() { } |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 InputDevice(bool firesTouchEvents); | 41 InputDevice(bool firesTouchEvents); |
| 40 InputDevice(const InputDeviceInit&); | 42 InputDevice(const InputDeviceInit&); |
| 41 | 43 |
| 42 // Whether this device dispatches touch events. This mainly lets developers | 44 // Whether this device dispatches touch events. This mainly lets developers |
| 43 // avoid handling both touch and mouse events dispatched for a single user | 45 // avoid handling both touch and mouse events dispatched for a single user |
| 44 // action. | 46 // action. |
| 45 bool m_firesTouchEvents; | 47 bool m_firesTouchEvents; |
| 46 }; | 48 }; |
| 47 | 49 |
| 48 } // namespace blink | 50 } // namespace blink |
| 49 | 51 |
| 50 #endif // InputDevice_h | 52 #endif // InputDevice_h |
| OLD | NEW |