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

Unified Diff: mojo/services/view_manager/window_tree_host_impl.cc

Issue 399743003: x11: Listen for and process XInput2 events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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/services/view_manager/window_tree_host_impl.cc
diff --git a/mojo/services/view_manager/window_tree_host_impl.cc b/mojo/services/view_manager/window_tree_host_impl.cc
index 5996186d3aadf72b209a0b630b325d682452b4f9..75e780c2f1170485aded5e5033bbf69cdb32a185 100644
--- a/mojo/services/view_manager/window_tree_host_impl.cc
+++ b/mojo/services/view_manager/window_tree_host_impl.cc
@@ -6,6 +6,7 @@
#include "mojo/services/view_manager/window_tree_host_impl.h"
#include "mojo/public/c/gles2/gles2.h"
#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
#include "mojo/services/view_manager/context_factory_impl.h"
#include "ui/aura/env.h"
#include "ui/aura/layout_manager.h"
@@ -185,38 +186,10 @@ void WindowTreeHostImpl::OnDestroyed(const mojo::Callback<void()>& callback) {
void WindowTreeHostImpl::OnEvent(EventPtr event,
const mojo::Callback<void()>& callback) {
- switch (event->action) {
- case ui::ET_MOUSE_PRESSED:
- case ui::ET_MOUSE_DRAGGED:
- case ui::ET_MOUSE_RELEASED:
- case ui::ET_MOUSE_MOVED:
- case ui::ET_MOUSE_ENTERED:
- case ui::ET_MOUSE_EXITED: {
- gfx::Point location(event->location->x, event->location->y);
- ui::MouseEvent ev(static_cast<ui::EventType>(event->action), location,
- location, event->flags, 0);
- SendEventToProcessor(&ev);
- break;
- }
- case ui::ET_MOUSEWHEEL: {
- gfx::Vector2d offset(event->wheel_data->x_offset,
- event->wheel_data->y_offset);
- gfx::Point location(event->location->x, event->location->y);
- ui::MouseWheelEvent ev(offset, location, location, event->flags, 0);
- SendEventToProcessor(&ev);
- break;
- }
- case ui::ET_KEY_PRESSED:
- case ui::ET_KEY_RELEASED: {
- ui::KeyEvent ev(
- static_cast<ui::EventType>(event->action),
- static_cast<ui::KeyboardCode>(event->key_data->key_code),
- event->flags, event->key_data->is_char);
- SendEventToProcessor(&ev);
- break;
- }
- // TODO(beng): touch, etc.
- }
+ scoped_ptr<ui::Event> ui_event =
+ TypeConverter<EventPtr, scoped_ptr<ui::Event> >::ConvertTo(event);
+ if (ui_event)
+ SendEventToProcessor(ui_event.get());
callback.Run();
};
« no previous file with comments | « mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc ('k') | ui/platform_window/x11/x11_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698