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

Unified Diff: ui/events/gesture_detection/gesture_detector.cc

Issue 617423002: Make GestureTextSelector detect its own gestures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sort gyp/gn Created 6 years, 2 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/events/gesture_detection/gesture_detector.h ('k') | ui/events/gesture_detection/gesture_listeners.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/gesture_detector.cc
diff --git a/ui/events/gesture_detection/gesture_detector.cc b/ui/events/gesture_detection/gesture_detector.cc
index 5dc61938b1ae4fff85ff6d8f30a836dd74075f96..c0924488165528b3331f02052b7597d644799a32 100644
--- a/ui/events/gesture_detection/gesture_detector.cc
+++ b/ui/events/gesture_detection/gesture_detector.cc
@@ -10,6 +10,7 @@
#include <cmath>
#include "base/timer/timer.h"
+#include "ui/events/gesture_detection/gesture_listeners.h"
#include "ui/events/gesture_detection/motion_event.h"
namespace ui {
@@ -57,62 +58,6 @@ GestureDetector::Config::Config()
GestureDetector::Config::~Config() {}
-bool GestureDetector::SimpleGestureListener::OnDown(const MotionEvent& e) {
- return false;
-}
-
-void GestureDetector::SimpleGestureListener::OnShowPress(const MotionEvent& e) {
-}
-
-bool GestureDetector::SimpleGestureListener::OnSingleTapUp(
- const MotionEvent& e) {
- return false;
-}
-
-void GestureDetector::SimpleGestureListener::OnLongPress(const MotionEvent& e) {
-}
-
-bool GestureDetector::SimpleGestureListener::OnScroll(const MotionEvent& e1,
- const MotionEvent& e2,
- float distance_x,
- float distance_y) {
- return false;
-}
-
-bool GestureDetector::SimpleGestureListener::OnFling(const MotionEvent& e1,
- const MotionEvent& e2,
- float velocity_x,
- float velocity_y) {
- return false;
-}
-
-bool GestureDetector::SimpleGestureListener::OnSwipe(const MotionEvent& e1,
- const MotionEvent& e2,
- float velocity_x,
- float velocity_y) {
- return false;
-}
-
-bool GestureDetector::SimpleGestureListener::OnTwoFingerTap(
- const MotionEvent& e1,
- const MotionEvent& e2) {
- return false;
-}
-
-bool GestureDetector::SimpleGestureListener::OnSingleTapConfirmed(
- const MotionEvent& e) {
- return false;
-}
-
-bool GestureDetector::SimpleGestureListener::OnDoubleTap(const MotionEvent& e) {
- return false;
-}
-
-bool GestureDetector::SimpleGestureListener::OnDoubleTapEvent(
- const MotionEvent& e) {
- return false;
-}
-
class GestureDetector::TimeoutGestureHandler {
public:
TimeoutGestureHandler(const Config& config, GestureDetector* gesture_detector)
@@ -187,6 +132,7 @@ GestureDetector::GestureDetector(
down_focus_x_(0),
down_focus_y_(0),
longpress_enabled_(true),
+ showpress_enabled_(true),
swipe_enabled_(false),
two_finger_tap_enabled_(false) {
DCHECK(listener_);
@@ -315,7 +261,8 @@ bool GestureDetector::OnTouchEvent(const MotionEvent& ev) {
// Always start the SHOW_PRESS timer before the LONG_PRESS timer to ensure
// proper timeout ordering.
- timeout_handler_->StartTimeout(SHOW_PRESS);
+ if (showpress_enabled_)
+ timeout_handler_->StartTimeout(SHOW_PRESS);
if (longpress_enabled_)
timeout_handler_->StartTimeout(LONG_PRESS);
handled |= listener_->OnDown(ev);
« no previous file with comments | « ui/events/gesture_detection/gesture_detector.h ('k') | ui/events/gesture_detection/gesture_listeners.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698