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

Unified Diff: mojo/converters/input_events/input_events_type_converters.cc

Issue 789363004: WindowManagerApp should recognize gestures (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rename Aura to Impl and add FIXME 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
Index: mojo/converters/input_events/input_events_type_converters.cc
diff --git a/mojo/converters/input_events/input_events_type_converters.cc b/mojo/converters/input_events/input_events_type_converters.cc
index cd783860b97f7c06e97f42c7ce306f7d862ef4fb..ae4138dd0e400fedea876abdb62cb7d9fd2a8cee 100644
--- a/mojo/converters/input_events/input_events_type_converters.cc
+++ b/mojo/converters/input_events/input_events_type_converters.cc
@@ -96,7 +96,7 @@ EventPtr TypeConverter<EventPtr, ui::Event>::Convert(const ui::Event& input) {
event->flags = EventFlags(input.flags());
event->time_stamp = input.time_stamp().ToInternalValue();
- if (input.IsMouseEvent() || input.IsTouchEvent()) {
+ if (input.IsMouseEvent() || input.IsTouchEvent() || input.IsGestureEvent()) {
const ui::LocatedEvent* located_event =
static_cast<const ui::LocatedEvent*>(&input);
@@ -116,6 +116,9 @@ EventPtr TypeConverter<EventPtr, ui::Event>::Convert(const ui::Event& input) {
TouchDataPtr touch_data(TouchData::New());
touch_data->pointer_id = touch_event->touch_id();
event->touch_data = touch_data.Pass();
+ } else if (input.IsGestureEvent()) {
+ // TODO(abarth): Create GestureData struct for |event| once we have that
+ // struct in input_events.mojom.
} else if (input.IsKeyEvent()) {
const ui::KeyEvent* key_event = static_cast<const ui::KeyEvent*>(&input);
KeyDataPtr key_data(KeyData::New());
@@ -158,6 +161,12 @@ EventPtr TypeConverter<EventPtr, ui::KeyEvent>::Convert(
}
// static
+EventPtr TypeConverter<EventPtr, ui::GestureEvent>::Convert(
+ const ui::GestureEvent& input) {
+ return Event::From(static_cast<const ui::Event&>(input));
+}
+
+// static
scoped_ptr<ui::Event> TypeConverter<scoped_ptr<ui::Event>, EventPtr>::Convert(
const EventPtr& input) {
scoped_ptr<ui::Event> ui_event;
« no previous file with comments | « mojo/converters/input_events/input_events_type_converters.h ('k') | services/window_manager/window_manager_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698