OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/touchui/gesture_manager.h" | 5 #include "views/touchui/gesture_manager.h" |
6 #ifndef NDEBUG | 6 #ifndef NDEBUG |
7 #include <iostream> | 7 #include <iostream> |
8 #endif | 8 #endif |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "views/events/event.h" | 11 #include "views/events/event.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, location.x(), location.y(), | 45 MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, location.x(), location.y(), |
46 event.flags()); | 46 event.flags()); |
47 source->OnMousePressed(mouse_event); | 47 source->OnMousePressed(mouse_event); |
48 return true; | 48 return true; |
49 } | 49 } |
50 | 50 |
51 if (event.type() == ui::ET_TOUCH_RELEASED) { | 51 if (event.type() == ui::ET_TOUCH_RELEASED) { |
52 DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchReleased"; | 52 DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchReleased"; |
53 MouseEvent mouse_event(ui::ET_MOUSE_RELEASED, location.x(), location.y(), | 53 MouseEvent mouse_event(ui::ET_MOUSE_RELEASED, location.x(), location.y(), |
54 event.flags()); | 54 event.flags()); |
55 source->OnMouseReleased(mouse_event, false); | 55 source->OnMouseReleased(mouse_event); |
56 return true; | 56 return true; |
57 } | 57 } |
58 | 58 |
59 if (event.type() == ui::ET_TOUCH_MOVED) { | 59 if (event.type() == ui::ET_TOUCH_MOVED) { |
60 DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchMotion"; | 60 DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchMotion"; |
61 MouseEvent mouse_event(ui::ET_MOUSE_DRAGGED, location.x(), location.y(), | 61 MouseEvent mouse_event(ui::ET_MOUSE_DRAGGED, location.x(), location.y(), |
62 event.flags()); | 62 event.flags()); |
63 source->OnMouseDragged(mouse_event); | 63 source->OnMouseDragged(mouse_event); |
64 return true; | 64 return true; |
65 } | 65 } |
66 | 66 |
67 DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: unhandled event"; | 67 DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: unhandled event"; |
68 return false; | 68 return false; |
69 } | 69 } |
70 | 70 |
71 GestureManager::GestureManager() { | 71 GestureManager::GestureManager() { |
72 } | 72 } |
73 | 73 |
74 } // namespace views | 74 } // namespace views |
OLD | NEW |