Index: ui/base/wayland/events_wayland.cc |
diff --git a/ui/base/wayland/events_wayland.cc b/ui/base/wayland/events_wayland.cc |
index df6ffacc048a0972f40f54cf10ff46ca0fcd8d5c..36e65bf54b31ac95c95cbae334eaae4027d820da 100644 |
--- a/ui/base/wayland/events_wayland.cc |
+++ b/ui/base/wayland/events_wayland.cc |
@@ -4,13 +4,32 @@ |
#include "ui/base/events.h" |
+#include <linux/input.h> |
#include <X11/extensions/XInput2.h> |
+#include "base/event_types.h" |
#include "base/logging.h" |
#include "ui/base/keycodes/keyboard_code_conversion_x.h" |
-#include "ui/wayland/events/wayland_event.h" |
#include "ui/gfx/point.h" |
+using namespace base::wayland; |
+ |
+ |
oshima
2011/11/11 20:36:53
remove extra line
|
+namespace ui { |
+ |
+// These are the mouse events expected. The event type Wayland sends is an |
+// evdev event. The following is the correct mapping from evdev to expected |
+// events type. |
+enum WaylandEventButtonType { |
+ LEFT_BUTTON = BTN_LEFT, |
+ MIDDLE_BUTTON = BTN_RIGHT, |
+ RIGHT_BUTTON = BTN_MIDDLE, |
+ SCROLL_UP = BTN_SIDE, |
+ SCROLL_DOWN = BTN_EXTRA, |
+}; |
+ |
+} // namespace ui |
+ |
namespace { |
// Scroll amount for each wheelscroll event. 53 is also the value used for GTK+. |
@@ -126,7 +145,7 @@ bool IsMouseEvent(const base::NativeEvent& native_event) { |
} |
int GetMouseWheelOffset(const base::NativeEvent& native_event) { |
- return native_event->button.button == ui::SCROLL_UP ? |
+ return native_event->button.button == SCROLL_UP ? |
kWheelScrollAmount : -kWheelScrollAmount; |
} |