Chromium Code Reviews| 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..1f844602c240936a2043a0a6a3d4deb9806bfc7f 100644 |
| --- a/ui/base/wayland/events_wayland.cc |
| +++ b/ui/base/wayland/events_wayland.cc |
| @@ -2,15 +2,34 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#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/events.h" |
|
oshima
2011/11/10 16:13:38
move this to top
Mandeep Singh Baines
2011/11/11 19:26:52
Done.
So why does it need to be at the top?
oshima
2011/11/11 20:36:53
Because the file defines the API this file impleme
|
| #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; |
| + |
| + |
| +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; |
| } |