Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 { | |
|
tkent
2015/06/04 00:00:47
Can we make this GarbageCollectedFinalized<> inste
lanwei
2015/06/04 21:21:35
Done.
Rick Byers
2015/06/10 20:37:05
I've been wondering about this. How do we decide
tkent
2015/06/10 22:50:03
There are no clear rules. However, new web-expose
| |
| 17 DEFINE_WRAPPERTYPEINFO(); | |
| 18 | |
| 19 public: | |
| 20 ~InputDevice(); | |
| 21 static PassRefPtrWillBeRawPtr<InputDevice> create() | |
| 22 { | |
| 23 return adoptRefWillBeNoop(new InputDevice); | |
| 24 } | |
| 25 | |
| 26 static PassRefPtrWillBeRawPtr<InputDevice> create(bool firesTouchEvents) | |
| 27 { | |
| 28 return adoptRefWillBeNoop(new InputDevice(firesTouchEvents)); | |
| 29 } | |
| 30 | |
| 31 static PassRefPtrWillBeRawPtr<InputDevice> create( | |
| 32 const InputDeviceInit& initializer) | |
| 33 { | |
| 34 return adoptRefWillBeNoop(new InputDevice(initializer)); | |
| 35 } | |
| 36 | |
| 37 bool firesTouchEvents() const { return m_firesTouchEvents; } | |
| 38 | |
| 39 DEFINE_INLINE_TRACE() { } | |
| 40 | |
| 41 private: | |
| 42 InputDevice(); | |
|
tkent
2015/06/04 00:00:47
Can we unify three constructors into one?
Rick Byers
2015/06/04 13:55:29
Yeah, perhaps we only want the InputDeviceInit fla
lanwei
2015/06/04 21:21:35
I think it is better to keep the one with a bool a
| |
| 43 InputDevice(bool); | |
| 44 InputDevice(const InputDeviceInit&); | |
| 45 | |
| 46 // Whether this device dispatches touch events. This mainly lets developers | |
| 47 // avoid handling both touch and mouse events dispatched for a single user | |
| 48 // action. | |
| 49 bool m_firesTouchEvents; | |
| 50 }; | |
| 51 | |
| 52 } // namespace blink | |
| 53 | |
| 54 #endif // InputDevice_h | |
| OLD | NEW |