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

Unified Diff: ui/events/gestures/gesture_provider_aura.cc

Issue 1358263002: [Android] Support double-tap selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix contextual search Created 5 years, 3 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/gestures/gesture_provider_aura.h ('k') | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gestures/gesture_provider_aura.cc
diff --git a/ui/events/gestures/gesture_provider_aura.cc b/ui/events/gestures/gesture_provider_aura.cc
index b491a2f0b85023e85765cd299c921f553e247101..4d9e6fc1176ae3e828f03b21b2b5334224076693 100644
--- a/ui/events/gestures/gesture_provider_aura.cc
+++ b/ui/events/gestures/gesture_provider_aura.cc
@@ -49,21 +49,6 @@ void GestureProviderAura::OnGestureEvent(
const GestureEventData& gesture) {
GestureEventDetails details = gesture.details;
details.set_oldest_touch_id(gesture.motion_event_id);
-
- if (gesture.type() == ET_GESTURE_TAP) {
- int tap_count = 1;
- if (previous_tap_ && IsConsideredDoubleTap(*previous_tap_, gesture))
- tap_count = 1 + (previous_tap_->details.tap_count() % 3);
- details.set_tap_count(tap_count);
- if (!previous_tap_)
- previous_tap_.reset(new GestureEventData(gesture));
- else
- *previous_tap_ = gesture;
- previous_tap_->details = details;
- } else if (gesture.type() == ET_GESTURE_TAP_CANCEL) {
- previous_tap_.reset();
- }
-
scoped_ptr<ui::GestureEvent> event(
new ui::GestureEvent(gesture.x,
gesture.y,
@@ -90,23 +75,4 @@ ScopedVector<GestureEvent>* GestureProviderAura::GetAndResetPendingGestures() {
return old_pending_gestures;
}
-bool GestureProviderAura::IsConsideredDoubleTap(
- const GestureEventData& previous_tap,
- const GestureEventData& current_tap) const {
- if (current_tap.time - previous_tap.time >
- base::TimeDelta::FromMilliseconds(
- GestureConfiguration::GetInstance()
- ->max_time_between_double_click_in_ms())) {
- return false;
- }
-
- float double_tap_slop_square =
- GestureConfiguration::GetInstance()
- ->max_distance_between_taps_for_double_tap();
- double_tap_slop_square *= double_tap_slop_square;
- const float delta_x = previous_tap.x - current_tap.x;
- const float delta_y = previous_tap.y - current_tap.y;
- return (delta_x * delta_x + delta_y * delta_y < double_tap_slop_square);
-}
-
} // namespace content
« no previous file with comments | « ui/events/gestures/gesture_provider_aura.h ('k') | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698