| OLD | NEW |
| 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/base/gestures/gesture_types.h" | 5 #include "ui/base/gestures/gesture_types.h" |
| 6 | 6 |
| 7 namespace ui { | 7 namespace ui { |
| 8 | 8 |
| 9 GestureEventDetails::GestureEventDetails(ui::EventType type, | 9 GestureEventDetails::GestureEventDetails(ui::EventType type, |
| 10 float delta_x, | 10 float delta_x, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for pinch"; | 32 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for pinch"; |
| 33 break; | 33 break; |
| 34 | 34 |
| 35 case ui::ET_GESTURE_MULTIFINGER_SWIPE: | 35 case ui::ET_GESTURE_MULTIFINGER_SWIPE: |
| 36 data.swipe.left = delta_x < 0; | 36 data.swipe.left = delta_x < 0; |
| 37 data.swipe.right = delta_x > 0; | 37 data.swipe.right = delta_x > 0; |
| 38 data.swipe.up = delta_y < 0; | 38 data.swipe.up = delta_y < 0; |
| 39 data.swipe.down = delta_y > 0; | 39 data.swipe.down = delta_y > 0; |
| 40 break; | 40 break; |
| 41 | 41 |
| 42 case ui::ET_GESTURE_TAP: |
| 43 data.tap_count = static_cast<int>(delta_x); |
| 44 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for tap."; |
| 45 break; |
| 46 |
| 42 default: | 47 default: |
| 43 data.generic.delta_x = delta_x; | 48 data.generic.delta_x = delta_x; |
| 44 data.generic.delta_y = delta_y; | 49 data.generic.delta_y = delta_y; |
| 45 if (delta_x != 0.f || delta_y != 0.f) { | 50 if (delta_x != 0.f || delta_y != 0.f) { |
| 46 DLOG(WARNING) << "A gesture event (" << type << ") had unknown data: (" | 51 DLOG(WARNING) << "A gesture event (" << type << ") had unknown data: (" |
| 47 << delta_x << "," << delta_y; | 52 << delta_x << "," << delta_y; |
| 48 } | 53 } |
| 49 break; | 54 break; |
| 50 } | 55 } |
| 51 } | 56 } |
| 52 | 57 |
| 53 } // namespace ui | 58 } // namespace ui |
| OLD | NEW |