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

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: Freshen 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
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/aura/test/aura_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/gestures/gesture_sequence.cc
diff --git a/ui/aura/gestures/gesture_sequence.cc b/ui/aura/gestures/gesture_sequence.cc
index bb99b30177c7d3cca6b29df44026e0bb40a3022e..180eabbca8fce9a296bc4740d3ce1a41ad3aa8ee 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 {
@@ -495,7 +485,8 @@ bool GestureSequence::TouchDown(const TouchEvent& event,
AppendTapDownGestureEvent(point, gestures);
long_press_timer_->Start(
FROM_HERE,
- base::TimeDelta::FromMilliseconds(kLongPressTimeInMilliseconds),
+ base::TimeDelta::FromSeconds(
+ GestureConfiguration::long_press_time_in_seconds()),
this,
&GestureSequence::AppendLongPressGestureEvent);
return true;
@@ -557,14 +548,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(
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/aura/test/aura_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698