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

Unified Diff: Source/core/input/InputDevice.h

Issue 1157173003: Impelement InputDevice.firesTouchEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add InputDevice to LayoutTests/webexposed Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/input/InputDevice.h
diff --git a/Source/core/input/InputDevice.h b/Source/core/input/InputDevice.h
new file mode 100644
index 0000000000000000000000000000000000000000..77486596855e1deda6c919b564e2454daf1d6ba6
--- /dev/null
+++ b/Source/core/input/InputDevice.h
@@ -0,0 +1,54 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef InputDevice_h
+#define InputDevice_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/CoreExport.h"
+#include "core/input/InputDeviceInit.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+
+namespace blink {
+
+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
+ DEFINE_WRAPPERTYPEINFO();
+
+public:
+ ~InputDevice();
+ static PassRefPtrWillBeRawPtr<InputDevice> create()
+ {
+ return adoptRefWillBeNoop(new InputDevice);
+ }
+
+ static PassRefPtrWillBeRawPtr<InputDevice> create(bool firesTouchEvents)
+ {
+ return adoptRefWillBeNoop(new InputDevice(firesTouchEvents));
+ }
+
+ static PassRefPtrWillBeRawPtr<InputDevice> create(
+ const InputDeviceInit& initializer)
+ {
+ return adoptRefWillBeNoop(new InputDevice(initializer));
+ }
+
+ bool firesTouchEvents() const { return m_firesTouchEvents; }
+
+ DEFINE_INLINE_TRACE() { }
+
+private:
+ 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
+ InputDevice(bool);
+ InputDevice(const InputDeviceInit&);
+
+ // Whether this device dispatches touch events. This mainly lets developers
+ // avoid handling both touch and mouse events dispatched for a single user
+ // action.
+ bool m_firesTouchEvents;
+};
+
+} // namespace blink
+
+#endif // InputDevice_h

Powered by Google App Engine
This is Rietveld 408576698