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

Side by Side Diff: ui/aura/gestures/gesture_point.h

Issue 9566020: Revert 124071 - Gestures are now possible using touch events with any ids (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/root_window_event_filter_unittest.cc ('k') | ui/aura/gestures/gesture_point.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_AURA_GESTURES_GESTURE_POINT_H_ 5 #ifndef UI_AURA_GESTURES_GESTURE_POINT_H_
6 #define UI_AURA_GESTURES_GESTURE_POINT_H_ 6 #define UI_AURA_GESTURES_GESTURE_POINT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/aura/gestures/velocity_calculator.h" 10 #include "ui/aura/gestures/velocity_calculator.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 bool BreaksVerticalRail(); 46 bool BreaksVerticalRail();
47 bool DidScroll(const TouchEvent& event, int distance) const; 47 bool DidScroll(const TouchEvent& event, int distance) const;
48 48
49 const gfx::Point& first_touch_position() const { 49 const gfx::Point& first_touch_position() const {
50 return first_touch_position_; 50 return first_touch_position_;
51 } 51 }
52 52
53 double last_touch_time() const { return last_touch_time_; } 53 double last_touch_time() const { return last_touch_time_; }
54 const gfx::Point& last_touch_position() const { return last_touch_position_; } 54 const gfx::Point& last_touch_position() const { return last_touch_position_; }
55 55
56 // point_id_ is used to drive GestureSequence::ProcessTouchEventForGesture. 56 void set_touch_id(unsigned int touch_id) { touch_id_ = touch_id; }
57 // point_ids are maintained such that the set of point_ids is always 57 unsigned int touch_id() const { return touch_id_; }
58 // contiguous, from 0 to the number of current touches.
59 // A lower point_id indicates that a touch occurred first.
60 // A negative point_id indicates that the GesturePoint is not currently
61 // associated with a touch.
62 void set_point_id(int point_id) { point_id_ = point_id; }
63 const int point_id() const { return point_id_; }
64
65 const bool in_use() const { return point_id_ >= 0; }
66 58
67 double x_delta() const { 59 double x_delta() const {
68 return last_touch_position_.x() - first_touch_position_.x(); 60 return last_touch_position_.x() - first_touch_position_.x();
69 } 61 }
70 62
71 double y_delta() const { 63 double y_delta() const {
72 return last_touch_position_.y() - first_touch_position_.y(); 64 return last_touch_position_.y() - first_touch_position_.y();
73 } 65 }
74 66
75 float XVelocity() { return velocity_calculator_.XVelocity(); } 67 float XVelocity() { return velocity_calculator_.XVelocity(); }
(...skipping 12 matching lines...) Expand all
88 gfx::Point first_touch_position_; 80 gfx::Point first_touch_position_;
89 double first_touch_time_; 81 double first_touch_time_;
90 gfx::Point last_touch_position_; 82 gfx::Point last_touch_position_;
91 double last_touch_time_; 83 double last_touch_time_;
92 84
93 double last_tap_time_; 85 double last_tap_time_;
94 gfx::Point last_tap_position_; 86 gfx::Point last_tap_position_;
95 87
96 VelocityCalculator velocity_calculator_; 88 VelocityCalculator velocity_calculator_;
97 89
98 int point_id_; 90 unsigned int touch_id_;
99 DISALLOW_COPY_AND_ASSIGN(GesturePoint); 91 DISALLOW_COPY_AND_ASSIGN(GesturePoint);
100 }; 92 };
101 93
102 } // namespace aura 94 } // namespace aura
103 95
104 #endif // UI_AURA_GESTURES_GESTURE_POINT_H_ 96 #endif // UI_AURA_GESTURES_GESTURE_POINT_H_
OLDNEW
« no previous file with comments | « ash/wm/root_window_event_filter_unittest.cc ('k') | ui/aura/gestures/gesture_point.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698