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

Side by Side Diff: ui/events/gesture_detection/gesture_detector.h

Issue 200623003: Adopt "QuickScale" double-tap drag zoom code in the GestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yeah... Created 6 years, 8 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
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 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_
6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/events/gesture_detection/gesture_detection_export.h" 10 #include "ui/events/gesture_detection/gesture_detection_export.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 DoubleTapListener* optional_double_tap_listener); 81 DoubleTapListener* optional_double_tap_listener);
82 ~GestureDetector(); 82 ~GestureDetector();
83 83
84 bool OnTouchEvent(const MotionEvent& ev); 84 bool OnTouchEvent(const MotionEvent& ev);
85 85
86 void set_doubletap_listener(DoubleTapListener* double_tap_listener) { 86 void set_doubletap_listener(DoubleTapListener* double_tap_listener) {
87 DCHECK(!is_double_tapping_ || double_tap_listener_); 87 DCHECK(!is_double_tapping_ || double_tap_listener_);
88 double_tap_listener_ = double_tap_listener; 88 double_tap_listener_ = double_tap_listener;
89 } 89 }
90 90
91 bool has_doubletap_listener() const { return double_tap_listener_ != NULL; }
92
93 bool is_double_tapping() const { return is_double_tapping_; }
94
91 void set_is_longpress_enabled(bool is_longpress_enabled) { 95 void set_is_longpress_enabled(bool is_longpress_enabled) {
92 is_longpress_enabled_ = is_longpress_enabled; 96 is_longpress_enabled_ = is_longpress_enabled;
93 } 97 }
94 98
95 bool is_longpress_enabled() const { return is_longpress_enabled_; } 99 bool is_longpress_enabled() const { return is_longpress_enabled_; }
96 100
97 private: 101 private:
98 void Init(const Config& config); 102 void Init(const Config& config);
99 void OnShowPressTimeout(); 103 void OnShowPressTimeout();
100 void OnLongPressTimeout(); 104 void OnLongPressTimeout();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 143
140 // Determines speed during touch scrolling. 144 // Determines speed during touch scrolling.
141 VelocityTrackerState velocity_tracker_; 145 VelocityTrackerState velocity_tracker_;
142 146
143 DISALLOW_COPY_AND_ASSIGN(GestureDetector); 147 DISALLOW_COPY_AND_ASSIGN(GestureDetector);
144 }; 148 };
145 149
146 } // namespace ui 150 } // namespace ui
147 151
148 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_ 152 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_DETECTOR_H_
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_config_helper_aura.cc ('k') | ui/events/gesture_detection/gesture_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698