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

Unified Diff: ui/base/events/event_dispatcher.cc

Issue 10912168: events: Add some test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win-component Created 8 years, 3 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
« no previous file with comments | « ui/base/events/event_dispatcher.h ('k') | ui/base/events/event_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events/event_dispatcher.cc
diff --git a/ui/base/events/event_dispatcher.cc b/ui/base/events/event_dispatcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ec9c5ac54e8eeee7d2638ca0664ec06d9c471d99
--- /dev/null
+++ b/ui/base/events/event_dispatcher.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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 "ui/base/events/event_dispatcher.h"
+
+namespace ui {
+
+EventDispatcher::EventDispatcher() {
+}
+
+EventDispatcher::~EventDispatcher() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// EventDispatcher, private:
+
+EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler,
+ KeyEvent* event) {
+ return handler->OnKeyEvent(event);
+}
+
+EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler,
+ MouseEvent* event) {
+ return handler->OnMouseEvent(event);
+}
+
+EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler,
+ ScrollEvent* event) {
+ return handler->OnScrollEvent(event);
+}
+
+EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler,
+ TouchEvent* event) {
+ // TODO(sad): This needs fixing (especially for the QUEUED_ status).
+ TouchStatus status = handler->OnTouchEvent(event);
+ return status == ui::TOUCH_STATUS_UNKNOWN ? ER_UNHANDLED :
+ status == ui::TOUCH_STATUS_QUEUED_END ? ER_CONSUMED :
+ ER_HANDLED;
+}
+
+EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler,
+ GestureEvent* event) {
+ return handler->OnGestureEvent(event);
+}
+
+} // namespace ui
« no previous file with comments | « ui/base/events/event_dispatcher.h ('k') | ui/base/events/event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698