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

Unified Diff: ui/events/ozone/evdev/device_event_dispatcher_evdev.h

Issue 869613003: [PATCH 5/11] ozone: evdev: Replace dispatch callbacks with an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: namespace ui Created 5 years, 11 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
« no previous file with comments | « ui/events/ozone/BUILD.gn ('k') | ui/events/ozone/evdev/device_event_dispatcher_evdev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73%
copy from ui/events/ozone/evdev/event_dispatch_callback.h
copy to ui/events/ozone/evdev/device_event_dispatcher_evdev.h
index 77dd488068deb3f60ab98ce4c6b9d907f431437e..f109c9f35af9a20d07a8a025b91b8689215f03e3 100644
--- a/ui/events/ozone/evdev/event_dispatch_callback.h
+++ b/ui/events/ozone/evdev/device_event_dispatcher_evdev.h
@@ -1,11 +1,10 @@
-// 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/events/ozone/evdev/events_ozone_evdev_export.h"
@@ -13,22 +12,8 @@
#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;
-
struct EVENTS_OZONE_EVDEV_EXPORT KeyEventParams {
KeyEventParams(int device_id, unsigned int code, bool down);
KeyEventParams(const KeyEventParams& other);
@@ -39,9 +24,6 @@ struct EVENTS_OZONE_EVDEV_EXPORT KeyEventParams {
bool down;
};
-typedef base::Callback<void(const KeyEventParams& params)>
- KeyEventDispatchCallback;
-
struct EVENTS_OZONE_EVDEV_EXPORT MouseMoveEventParams {
MouseMoveEventParams(int device_id, const gfx::PointF& location);
MouseMoveEventParams(const MouseMoveEventParams& other);
@@ -51,9 +33,6 @@ struct EVENTS_OZONE_EVDEV_EXPORT MouseMoveEventParams {
gfx::PointF location;
};
-typedef base::Callback<void(const MouseMoveEventParams& params)>
- MouseMoveEventDispatchCallback;
-
struct EVENTS_OZONE_EVDEV_EXPORT MouseButtonEventParams {
MouseButtonEventParams(int device_id,
const gfx::PointF& location,
@@ -70,9 +49,6 @@ struct EVENTS_OZONE_EVDEV_EXPORT MouseButtonEventParams {
bool allow_remap;
};
-typedef base::Callback<void(const MouseButtonEventParams& params)>
- MouseButtonEventDispatchCallback;
-
struct EVENTS_OZONE_EVDEV_EXPORT MouseWheelEventParams {
MouseWheelEventParams(int device_id,
const gfx::PointF& location,
@@ -85,9 +61,6 @@ struct EVENTS_OZONE_EVDEV_EXPORT MouseWheelEventParams {
gfx::Vector2d delta;
};
-typedef base::Callback<void(const MouseWheelEventParams& params)>
- MouseWheelEventDispatchCallback;
-
struct EVENTS_OZONE_EVDEV_EXPORT ScrollEventParams {
ScrollEventParams(int device_id,
EventType type,
@@ -108,9 +81,6 @@ struct EVENTS_OZONE_EVDEV_EXPORT ScrollEventParams {
const base::TimeDelta timestamp;
};
-typedef base::Callback<void(const ScrollEventParams& params)>
- ScrollEventDispatchCallback;
-
struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams {
TouchEventParams(int device_id,
int touch_id,
@@ -131,9 +101,21 @@ struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams {
base::TimeDelta timestamp;
};
-typedef base::Callback<void(const TouchEventParams& params)>
- TouchEventDispatchCallback;
+// Interface used by device objects for event dispatch.
+class EVENTS_OZONE_EVDEV_EXPORT DeviceEventDispatcherEvdev {
+ public:
+ DeviceEventDispatcherEvdev() {}
+ virtual ~DeviceEventDispatcherEvdev() {}
+
+ virtual void DispatchKeyEvent(const KeyEventParams& params) = 0;
+ virtual void DispatchMouseMoveEvent(const MouseMoveEventParams& params) = 0;
+ virtual void DispatchMouseButtonEvent(
+ const MouseButtonEventParams& params) = 0;
+ virtual void DispatchMouseWheelEvent(const MouseWheelEventParams& params) = 0;
+ virtual void DispatchScrollEvent(const ScrollEventParams& params) = 0;
+ virtual void DispatchTouchEvent(const TouchEventParams& params) = 0;
+};
-} // namspace ui
+} // namespace ui
-#endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_
+#endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_
« no previous file with comments | « ui/events/ozone/BUILD.gn ('k') | ui/events/ozone/evdev/device_event_dispatcher_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698