| OLD | NEW |
| 1 // Copyright (c) 2011 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 View* source, | 25 View* source, |
| 26 ui::TouchStatus status) { | 26 ui::TouchStatus status) { |
| 27 if (status != ui::TOUCH_STATUS_UNKNOWN) | 27 if (status != ui::TOUCH_STATUS_UNKNOWN) |
| 28 return false; // The event was consumed by a touch sequence. | 28 return false; // The event was consumed by a touch sequence. |
| 29 | 29 |
| 30 // TODO(rjkroege): A realistic version of the GestureManager will | 30 // TODO(rjkroege): A realistic version of the GestureManager will |
| 31 // appear in a subsequent CL. This interim version permits verifying that the | 31 // appear in a subsequent CL. This interim version permits verifying that the |
| 32 // event distribution code works by turning all touch inputs into | 32 // event distribution code works by turning all touch inputs into |
| 33 // mouse approximations. | 33 // mouse approximations. |
| 34 | 34 |
| 35 // Conver the touch-event into a mouse-event. This mouse-event gets its |
| 36 // location information from the native-event, so it needs to drop on the |
| 37 // toplevel widget instead of just source->GetWidget. |
| 35 Event::FromNativeEvent2 from_native; | 38 Event::FromNativeEvent2 from_native; |
| 36 MouseEvent mouseev(event, from_native); | 39 MouseEvent mouseev(event, from_native); |
| 37 source->GetWidget()->OnMouseEvent(mouseev); | 40 source->GetWidget()->GetTopLevelWidget()->OnMouseEvent(mouseev); |
| 38 return true; | 41 return true; |
| 39 } | 42 } |
| 40 | 43 |
| 41 GestureManager::GestureManager() { | 44 GestureManager::GestureManager() { |
| 42 } | 45 } |
| 43 | 46 |
| 44 } // namespace views | 47 } // namespace views |
| OLD | NEW |