Index: ui/events/ozone/evdev/device_event_dispatcher_evdev.h |
diff --git a/ui/events/ozone/evdev/event_dispatch_callback.h b/ui/events/ozone/evdev/device_event_dispatcher_evdev.h |
similarity index 50% |
copy from ui/events/ozone/evdev/event_dispatch_callback.h |
copy to ui/events/ozone/evdev/device_event_dispatcher_evdev.h |
index 077e30dd017bc58d3f12914fe18d18c1e5b276ea..5e132a039ef6d4d0a0e7ef2c0758d4f25de1890d 100644 |
--- a/ui/events/ozone/evdev/event_dispatch_callback.h |
+++ b/ui/events/ozone/evdev/device_event_dispatcher_evdev.h |
@@ -1,49 +1,18 @@ |
-// Copyright 2014 The Chromium Authors. All rights reserved. |
+// 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 UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ |
-#define UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ |
+#ifndef UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ |
+#define UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ |
-#include "base/callback.h" |
#include "base/time/time.h" |
#include "ui/events/event_constants.h" |
#include "ui/gfx/geometry/point_f.h" |
+#include "ui/gfx/geometry/vector2d.h" |
#include "ui/gfx/geometry/vector2d_f.h" |
-namespace base { |
-class TimeDelta; |
-} |
- |
-namespace gfx { |
-class PointF; |
-class Vector2d; |
-class Vector2dF; |
-} |
- |
namespace ui { |
-class Event; |
- |
-typedef base::Callback<void(scoped_ptr<Event>)> EventDispatchCallback; |
- |
-typedef base::Callback<void(int device_id, unsigned int code, bool down)> |
- KeyEventDispatchCallback; |
- |
-typedef base::Callback<void(int device_id, const gfx::PointF& location)> |
- MouseMoveEventDispatchCallback; |
- |
-typedef base::Callback<void(int device_id, |
- const gfx::PointF& location, |
- unsigned int button, |
- bool down, |
- bool allow_remap)> MouseButtonEventDispatchCallback; |
- |
-typedef base::Callback<void(int device_id, |
- const gfx::PointF& location, |
- const gfx::Vector2d& delta)> |
- MouseWheelEventDispatchCallback; |
- |
struct ScrollEventParams { |
ScrollEventParams(int device_id, |
EventType type, |
@@ -64,9 +33,6 @@ struct ScrollEventParams { |
const base::TimeDelta timestamp; |
}; |
-typedef base::Callback<void(const ScrollEventParams& params)> |
- ScrollEventDispatchCallback; |
- |
struct TouchEventParams { |
TouchEventParams(int device_id, |
int touch_id, |
@@ -87,9 +53,29 @@ struct TouchEventParams { |
base::TimeDelta timestamp; |
}; |
-typedef base::Callback<void(const TouchEventParams& params)> |
- TouchEventDispatchCallback; |
+// Interface used by device objects for event dispatch. |
+class DeviceEventDispatcherEvdev { |
+ public: |
+ DeviceEventDispatcherEvdev() {} |
+ virtual ~DeviceEventDispatcherEvdev() {} |
+ |
+ virtual void DispatchKeyEvent(int device_id, |
+ unsigned int code, |
+ bool down) = 0; |
+ virtual void DispatchMouseMoveEvent(int device_id, |
+ const gfx::PointF& location) = 0; |
+ virtual void DispatchMouseButtonEvent(int device_id, |
+ const gfx::PointF& location, |
+ unsigned int button, |
+ bool down, |
+ bool allow_remap) = 0; |
+ virtual void DispatchMouseWheelEvent(int device_id, |
+ const gfx::PointF& location, |
+ const gfx::Vector2d& delta) = 0; |
+ virtual void DispatchScrollEvent(const ScrollEventParams& params) = 0; |
+ virtual void DispatchTouchEvent(const TouchEventParams& params) = 0; |
+}; |
-} // namspace ui |
+} // namespace |
alexst (slow to review)
2015/01/27 18:50:30
// namspace ui
|
-#endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ |
+#endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ |