Index: trunk/src/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc |
=================================================================== |
--- trunk/src/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc (revision 273733) |
+++ trunk/src/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc (working copy) |
@@ -1,44 +0,0 @@ |
-// Copyright 2014 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. |
- |
-#include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
- |
-#include "mojo/services/public/cpp/geometry/geometry_type_converters.h" |
-#include "ui/events/keycodes/keyboard_codes.h" |
- |
-namespace mojo { |
- |
-// static |
-EventPtr TypeConverter<EventPtr, ui::Event>::ConvertFrom( |
- const ui::Event& input) { |
- EventPtr event(Event::New()); |
- event->action = input.type(); |
- event->flags = input.flags(); |
- event->time_stamp = input.time_stamp().ToInternalValue(); |
- |
- if (input.IsMouseEvent() || input.IsTouchEvent()) { |
- const ui::LocatedEvent* located_event = |
- static_cast<const ui::LocatedEvent*>(&input); |
- event->location = |
- TypeConverter<PointPtr, gfx::Point>::ConvertFrom( |
- located_event->location()); |
- } |
- |
- if (input.IsTouchEvent()) { |
- const ui::TouchEvent* touch_event = |
- static_cast<const ui::TouchEvent*>(&input); |
- TouchDataPtr touch_data(TouchData::New()); |
- touch_data->pointer_id = touch_event->touch_id(); |
- event->touch_data = touch_data.Pass(); |
- } else if (input.IsKeyEvent()) { |
- const ui::KeyEvent* key_event = static_cast<const ui::KeyEvent*>(&input); |
- KeyDataPtr key_data(KeyData::New()); |
- key_data->key_code = key_event->key_code(); |
- key_data->is_char = key_event->is_char(); |
- event->key_data = key_data.Pass(); |
- } |
- return event.Pass(); |
-} |
- |
-} // namespace mojo |