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

Side by Side Diff: ui/events/gestures/motion_event_aura.cc

Issue 504183005: Use MotionEvent::MAX_TOUCH_POINT_COUNT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « ui/events/gestures/motion_event_aura.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ui/events/gestures/motion_event_aura.h" 5 #include "ui/events/gestures/motion_event_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/events/gestures/gesture_configuration.h" 8 #include "ui/events/gestures/gesture_configuration.h"
9 9
10 namespace ui { 10 namespace ui {
11 11
12 MotionEventAura::MotionEventAura() 12 MotionEventAura::MotionEventAura()
13 : pointer_count_(0), cached_action_index_(-1) { 13 : pointer_count_(0), cached_action_index_(-1) {
14 } 14 }
15 15
16 MotionEventAura::MotionEventAura(size_t pointer_count, 16 MotionEventAura::MotionEventAura(
17 const base::TimeTicks& last_touch_time, 17 size_t pointer_count,
18 Action cached_action, 18 const base::TimeTicks& last_touch_time,
19 int cached_action_index, 19 Action cached_action,
20 const PointData (&active_touches)[10/*TODO*/]) 20 int cached_action_index,
21 const PointData (&active_touches)[MotionEvent::MAX_TOUCH_POINT_COUNT])
21 : pointer_count_(pointer_count), 22 : pointer_count_(pointer_count),
22 last_touch_time_(last_touch_time), 23 last_touch_time_(last_touch_time),
23 cached_action_(cached_action), 24 cached_action_(cached_action),
24 cached_action_index_(cached_action_index) { 25 cached_action_index_(cached_action_index) {
25 DCHECK(pointer_count_); 26 DCHECK(pointer_count_);
26 for (size_t i = 0; i < pointer_count; ++i) 27 for (size_t i = 0; i < pointer_count; ++i)
27 active_touches_[i] = active_touches[i]; 28 active_touches_[i] = active_touches[i];
28 } 29 }
29 30
30 MotionEventAura::~MotionEventAura() {} 31 MotionEventAura::~MotionEventAura() {}
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 size_t MotionEventAura::GetIndexFromId(int id) const { 231 size_t MotionEventAura::GetIndexFromId(int id) const {
231 for (size_t i = 0; i < pointer_count_; ++i) { 232 for (size_t i = 0; i < pointer_count_; ++i) {
232 if (active_touches_[i].touch_id == id) 233 if (active_touches_[i].touch_id == id)
233 return i; 234 return i;
234 } 235 }
235 NOTREACHED(); 236 NOTREACHED();
236 return 0; 237 return 0;
237 } 238 }
238 239
239 } // namespace ui 240 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gestures/motion_event_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698