Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
| 6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
| 7 | 7 |
| 8 #include "ui/events/gestures/motion_event_aura.h" | 8 #include "ui/events/gestures/motion_event_aura.h" |
| 9 | 9 |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 case ET_TOUCH_RELEASED: | 175 case ET_TOUCH_RELEASED: |
| 176 if (GetPointerCount() == 1) { | 176 if (GetPointerCount() == 1) { |
| 177 set_action(ACTION_UP); | 177 set_action(ACTION_UP); |
| 178 } else { | 178 } else { |
| 179 set_action(ACTION_POINTER_UP); | 179 set_action(ACTION_POINTER_UP); |
| 180 set_action_index(GetIndexFromId(touch.touch_id())); | 180 set_action_index(GetIndexFromId(touch.touch_id())); |
| 181 } | 181 } |
| 182 break; | 182 break; |
| 183 case ET_TOUCH_CANCELLED: | 183 case ET_TOUCH_CANCELLED: |
| 184 set_action(ACTION_CANCEL); | 184 set_action(ACTION_CANCEL); |
| 185 set_action_index(GetIndexFromId(touch.touch_id())); | |
|
tdresser
2015/05/04 20:41:10
This causes us to deviate from the Android impleme
jdduke (slow)
2015/05/04 20:46:43
Yeah, I'd prefer that we not overload the meaning
| |
| 185 break; | 186 break; |
| 186 case ET_TOUCH_MOVED: | 187 case ET_TOUCH_MOVED: |
| 187 set_action(ACTION_MOVE); | 188 set_action(ACTION_MOVE); |
| 189 set_action_index(GetIndexFromId(touch.touch_id())); | |
| 188 break; | 190 break; |
| 189 default: | 191 default: |
| 190 NOTREACHED(); | 192 NOTREACHED(); |
| 191 break; | 193 break; |
| 192 } | 194 } |
| 193 } | 195 } |
| 194 | 196 |
| 195 int MotionEventAura::GetIndexFromId(int id) const { | 197 int MotionEventAura::GetIndexFromId(int id) const { |
| 196 int index = FindPointerIndexOfId(id); | 198 int index = FindPointerIndexOfId(id); |
| 197 DCHECK_GE(index, 0); | 199 DCHECK_GE(index, 0); |
| 198 DCHECK_LT(index, static_cast<int>(GetPointerCount())); | 200 DCHECK_LT(index, static_cast<int>(GetPointerCount())); |
| 199 return index; | 201 return index; |
| 200 } | 202 } |
| 201 | 203 |
| 202 } // namespace ui | 204 } // namespace ui |
| OLD | NEW |