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

Side by Side Diff: ui/aura/event_filter.cc

Issue 10964051: events: Clean up dispatching code for touch-events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/event_filter.h" 5 #include "ui/aura/event_filter.h"
6 6
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/base/events/event.h" 8 #include "ui/base/events/event.h"
9 9
10 namespace aura { 10 namespace aura {
(...skipping 23 matching lines...) Expand all
34 34
35 ui::EventResult EventFilter::OnMouseEvent(ui::MouseEvent* event) { 35 ui::EventResult EventFilter::OnMouseEvent(ui::MouseEvent* event) {
36 return PreHandleMouseEvent(static_cast<Window*>(event->target()), event) ? 36 return PreHandleMouseEvent(static_cast<Window*>(event->target()), event) ?
37 ui::ER_CONSUMED : ui::ER_UNHANDLED; 37 ui::ER_CONSUMED : ui::ER_UNHANDLED;
38 } 38 }
39 39
40 ui::EventResult EventFilter::OnScrollEvent(ui::ScrollEvent* event) { 40 ui::EventResult EventFilter::OnScrollEvent(ui::ScrollEvent* event) {
41 return ui::ER_UNHANDLED; 41 return ui::ER_UNHANDLED;
42 } 42 }
43 43
44 ui::TouchStatus EventFilter::OnTouchEvent(ui::TouchEvent* event) { 44 ui::EventResult EventFilter::OnTouchEvent(ui::TouchEvent* event) {
45 return PreHandleTouchEvent(static_cast<Window*>(event->target()), event); 45 ui::TouchStatus status = PreHandleTouchEvent(
46 static_cast<Window*>(event->target()), event);
47 switch (status) {
48 case ui::TOUCH_STATUS_UNKNOWN:
49 return ui::ER_UNHANDLED;
50
51 case ui::TOUCH_STATUS_START:
52 case ui::TOUCH_STATUS_CONTINUE:
53 case ui::TOUCH_STATUS_END:
54 return ui::ER_CONSUMED;
55
56 case ui::TOUCH_STATUS_QUEUED:
57 case ui::TOUCH_STATUS_QUEUED_END:
58 return ui::ER_ASYNC;
59 }
60
61 NOTREACHED();
62 return ui::ER_UNHANDLED;
46 } 63 }
47 64
48 ui::EventResult EventFilter::OnGestureEvent(ui::GestureEvent* event) { 65 ui::EventResult EventFilter::OnGestureEvent(ui::GestureEvent* event) {
49 return PreHandleGestureEvent(static_cast<Window*>(event->target()), event); 66 return PreHandleGestureEvent(static_cast<Window*>(event->target()), event);
50 } 67 }
51 68
52 } // namespace aura 69 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698