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

Unified Diff: ui/aura/gestures/gesture_sequence.cc

Issue 9751011: Gesture recognition constants should all be stored in the GestureConfiguration object. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Protect unit tests from changes in GestureConfiguration. 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 side-by-side diff with in-line comments
Download patch
Index: ui/aura/gestures/gesture_sequence.cc
diff --git a/ui/aura/gestures/gesture_sequence.cc b/ui/aura/gestures/gesture_sequence.cc
index ae92b43eb811aafa49acb07b016ceae2e9661d48..b65a945e7a412b7168cc9517faa681573aca0489 100644
--- a/ui/aura/gestures/gesture_sequence.cc
+++ b/ui/aura/gestures/gesture_sequence.cc
@@ -12,16 +12,6 @@
#include "ui/aura/gestures/gesture_configuration.h"
#include "ui/base/events.h"
-namespace {
-
-// TODO(girard): Make these configurable in sync with this CL
-// http://crbug.com/100773
-const float kMinimumPinchUpdateDistance = 5; // in pixels
-const float kMinimumDistanceForPinchScroll = 20;
-const float kLongPressTimeInMilliseconds = 500;
-
-} // namespace
-
namespace aura {
namespace {
@@ -492,7 +482,8 @@ bool GestureSequence::TouchDown(const TouchEvent& event,
AppendTapDownGestureEvent(point, gestures);
long_press_timer_->Start(
FROM_HERE,
- base::TimeDelta::FromMilliseconds(kLongPressTimeInMilliseconds),
+ base::TimeDelta::FromMilliseconds(
+ GestureConfiguration::long_press_time_in_ms()),
this,
&GestureSequence::AppendLongPressGestureEvent);
return true;
@@ -554,14 +545,14 @@ bool GestureSequence::PinchUpdate(const TouchEvent& event,
float distance = point1->Distance(*point2);
if (abs(distance - pinch_distance_current_) <
- GestureConfiguration::minimum_pinch_update_distance_in_pixels()) {
+ GestureConfiguration::min_pinch_update_distance_in_pixels()) {
// The fingers didn't move towards each other, or away from each other,
// enough to constitute a pinch. But perhaps they moved enough in the same
// direction to do a two-finger scroll.
if (!point1->DidScroll(event,
- GestureConfiguration::minimum_distance_for_pinch_scroll_in_pixels()) ||
+ GestureConfiguration::min_distance_for_pinch_scroll_in_pixels()) ||
!point2->DidScroll(event,
- GestureConfiguration::minimum_distance_for_pinch_scroll_in_pixels()))
+ GestureConfiguration::min_distance_for_pinch_scroll_in_pixels()))
return false;
gfx::Point center = point1->last_touch_position().Middle(

Powered by Google App Engine
This is Rietveld 408576698