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

Side by Side Diff: ui/base/gestures/gesture_point.cc

Issue 10878085: Change default values of some gesture related constants (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/gestures/gesture_configuration.cc ('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 (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_point.h" 5 #include "ui/base/gestures/gesture_point.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/base/event.h" 10 #include "ui/base/event.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return duration < GestureConfiguration::max_seconds_between_double_click(); 148 return duration < GestureConfiguration::max_seconds_between_double_click();
149 } 149 }
150 150
151 bool GesturePoint::IsInsideManhattanSquare(const TouchEvent& event) const { 151 bool GesturePoint::IsInsideManhattanSquare(const TouchEvent& event) const {
152 return ui::gestures::IsInsideManhattanSquare(event.location(), 152 return ui::gestures::IsInsideManhattanSquare(event.location(),
153 first_touch_position_); 153 first_touch_position_);
154 } 154 }
155 155
156 bool GesturePoint::IsSecondClickInsideManhattanSquare( 156 bool GesturePoint::IsSecondClickInsideManhattanSquare(
157 const TouchEvent& event) const { 157 const TouchEvent& event) const {
158 return ui::gestures::IsInsideManhattanSquare(event.location(), 158 int manhattan_distance = abs(event.location().x() - last_tap_position_.x()) +
159 last_tap_position_); 159 abs(event.location().y() - last_tap_position_.y());
160 return manhattan_distance <
161 GestureConfiguration::max_distance_between_taps_for_double_tap();
160 } 162 }
161 163
162 bool GesturePoint::IsOverMinFlickSpeed() { 164 bool GesturePoint::IsOverMinFlickSpeed() {
163 return velocity_calculator_.VelocitySquared() > 165 return velocity_calculator_.VelocitySquared() >
164 GestureConfiguration::min_flick_speed_squared(); 166 GestureConfiguration::min_flick_speed_squared();
165 } 167 }
166 168
167 void GesturePoint::UpdateEnclosingRectangle(const TouchEvent& event) { 169 void GesturePoint::UpdateEnclosingRectangle(const TouchEvent& event) {
168 int radius; 170 int radius;
169 171
(...skipping 18 matching lines...) Expand all
188 event.location().y() - radius, 190 event.location().y() - radius,
189 radius * 2, 191 radius * 2,
190 radius * 2); 192 radius * 2);
191 if (IsInClickWindow(event)) 193 if (IsInClickWindow(event))
192 enclosing_rect_ = enclosing_rect_.Union(rect); 194 enclosing_rect_ = enclosing_rect_.Union(rect);
193 else 195 else
194 enclosing_rect_ = rect; 196 enclosing_rect_ = rect;
195 } 197 }
196 198
197 } // namespace ui 199 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/gestures/gesture_configuration.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698