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

Side by Side Diff: ui/events/gesture_detection/scale_gesture_detector.cc

Issue 298823006: [Aura] Reduce frequency of PinchUpdate events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Jared's comments. Created 6 years, 7 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/events/gesture_detection/scale_gesture_detector.h ('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 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 15 matching lines...) Expand all
26 26
27 const float kScaleFactor = .5f; 27 const float kScaleFactor = .5f;
28 28
29 } // namespace 29 } // namespace
30 30
31 // Note: These constants were taken directly from the default (unscaled) 31 // Note: These constants were taken directly from the default (unscaled)
32 // versions found in Android's ViewConfiguration. 32 // versions found in Android's ViewConfiguration.
33 ScaleGestureDetector::Config::Config() 33 ScaleGestureDetector::Config::Config()
34 : min_scaling_touch_major(48), 34 : min_scaling_touch_major(48),
35 min_scaling_span(200), 35 min_scaling_span(200),
36 quick_scale_enabled(true) {} 36 quick_scale_enabled(true),
37 min_pinch_update_span_delta(0) {
38 }
37 39
38 ScaleGestureDetector::Config::~Config() {} 40 ScaleGestureDetector::Config::~Config() {}
39 41
40 bool ScaleGestureDetector::SimpleScaleGestureListener::OnScale( 42 bool ScaleGestureDetector::SimpleScaleGestureListener::OnScale(
41 const ScaleGestureDetector&, const MotionEvent&) { 43 const ScaleGestureDetector&, const MotionEvent&) {
42 return false; 44 return false;
43 } 45 }
44 46
45 bool ScaleGestureDetector::SimpleScaleGestureListener::OnScaleBegin( 47 bool ScaleGestureDetector::SimpleScaleGestureListener::OnScaleBegin(
46 const ScaleGestureDetector&, const MotionEvent&) { 48 const ScaleGestureDetector&, const MotionEvent&) {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 367
366 void ScaleGestureDetector::ClearTouchHistory() { 368 void ScaleGestureDetector::ClearTouchHistory() {
367 touch_upper_ = std::numeric_limits<float>::quiet_NaN(); 369 touch_upper_ = std::numeric_limits<float>::quiet_NaN();
368 touch_lower_ = std::numeric_limits<float>::quiet_NaN(); 370 touch_lower_ = std::numeric_limits<float>::quiet_NaN();
369 touch_history_last_accepted_ = std::numeric_limits<float>::quiet_NaN(); 371 touch_history_last_accepted_ = std::numeric_limits<float>::quiet_NaN();
370 touch_history_direction_ = 0; 372 touch_history_direction_ = 0;
371 touch_history_last_accepted_time_ = base::TimeTicks(); 373 touch_history_last_accepted_time_ = base::TimeTicks();
372 } 374 }
373 375
374 } // namespace ui 376 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/scale_gesture_detector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698