| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/base/events/event_dispatcher.h" |
| 6 |
| 7 namespace ui { |
| 8 |
| 9 EventDispatcher::EventDispatcher() { |
| 10 } |
| 11 |
| 12 EventDispatcher::~EventDispatcher() { |
| 13 } |
| 14 |
| 15 //////////////////////////////////////////////////////////////////////////////// |
| 16 // EventDispatcher, private: |
| 17 |
| 18 EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler, |
| 19 KeyEvent* event) { |
| 20 return handler->OnKeyEvent(event); |
| 21 } |
| 22 |
| 23 EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler, |
| 24 MouseEvent* event) { |
| 25 return handler->OnMouseEvent(event); |
| 26 } |
| 27 |
| 28 EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler, |
| 29 ScrollEvent* event) { |
| 30 return handler->OnScrollEvent(event); |
| 31 } |
| 32 |
| 33 EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler, |
| 34 TouchEvent* event) { |
| 35 // TODO(sad): This needs fixing (especially for the QUEUED_ status). |
| 36 TouchStatus status = handler->OnTouchEvent(event); |
| 37 return status == ui::TOUCH_STATUS_UNKNOWN ? ER_UNHANDLED : |
| 38 status == ui::TOUCH_STATUS_QUEUED_END ? ER_CONSUMED : |
| 39 ER_HANDLED; |
| 40 } |
| 41 |
| 42 EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler, |
| 43 GestureEvent* event) { |
| 44 return handler->OnGestureEvent(event); |
| 45 } |
| 46 |
| 47 } // namespace ui |
| OLD | NEW |