| OLD | NEW |
| 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/gesture_detection/scale_gesture_detector.h" | 5 #include "ui/events/gesture_detection/scale_gesture_detector.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/float_util.h" | 10 #include "base/float_util.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // region and DPI scale are reasonably proportioned). | 23 // region and DPI scale are reasonably proportioned). |
| 24 const float kSlopEpsilon = .05f; | 24 const float kSlopEpsilon = .05f; |
| 25 | 25 |
| 26 const int kTouchStabilizeTimeMs = 128; | 26 const int kTouchStabilizeTimeMs = 128; |
| 27 | 27 |
| 28 const float kScaleFactor = .5f; | 28 const float kScaleFactor = .5f; |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 // Note: These constants were taken directly from the default (unscaled) | 32 // Note: These constants were taken directly from the default (unscaled) |
| 33 // versions found in Android's ViewConfiguration. | 33 // versions found in Android's ViewConfiguration. Do not change these default |
| 34 // values without explicitly consulting an OWNER. |
| 34 ScaleGestureDetector::Config::Config() | 35 ScaleGestureDetector::Config::Config() |
| 35 : span_slop(16), | 36 : span_slop(16), |
| 36 min_scaling_touch_major(48), | 37 min_scaling_touch_major(48), |
| 37 min_scaling_span(200), | 38 min_scaling_span(200), |
| 38 min_pinch_update_span_delta(0) { | 39 min_pinch_update_span_delta(0) { |
| 39 } | 40 } |
| 40 | 41 |
| 41 ScaleGestureDetector::Config::~Config() {} | 42 ScaleGestureDetector::Config::~Config() {} |
| 42 | 43 |
| 43 ScaleGestureDetector::ScaleGestureDetector(const Config& config, | 44 ScaleGestureDetector::ScaleGestureDetector(const Config& config, |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 touch_history_last_accepted_time_ = base::TimeTicks(); | 346 touch_history_last_accepted_time_ = base::TimeTicks(); |
| 346 } | 347 } |
| 347 | 348 |
| 348 void ScaleGestureDetector::ResetScaleWithSpan(float span) { | 349 void ScaleGestureDetector::ResetScaleWithSpan(float span) { |
| 349 in_progress_ = false; | 350 in_progress_ = false; |
| 350 initial_span_ = span; | 351 initial_span_ = span; |
| 351 double_tap_mode_ = DOUBLE_TAP_MODE_NONE; | 352 double_tap_mode_ = DOUBLE_TAP_MODE_NONE; |
| 352 } | 353 } |
| 353 | 354 |
| 354 } // namespace ui | 355 } // namespace ui |
| OLD | NEW |