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

Side by Side Diff: ui/events/gestures/gesture_recognizer_impl.cc

Issue 630003003: Change GestureConfiguration types to be consistent with each other and with the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gestures/gesture_recognizer_impl.h" 5 #include "ui/events/gestures/gesture_recognizer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 GestureConsumer* GestureRecognizerImpl::GetTargetForGestureEvent( 84 GestureConsumer* GestureRecognizerImpl::GetTargetForGestureEvent(
85 const GestureEvent& event) { 85 const GestureEvent& event) {
86 GestureConsumer* target = NULL; 86 GestureConsumer* target = NULL;
87 int touch_id = event.details().oldest_touch_id(); 87 int touch_id = event.details().oldest_touch_id();
88 target = touch_id_target_for_gestures_[touch_id]; 88 target = touch_id_target_for_gestures_[touch_id];
89 return target; 89 return target;
90 } 90 }
91 91
92 GestureConsumer* GestureRecognizerImpl::GetTargetForLocation( 92 GestureConsumer* GestureRecognizerImpl::GetTargetForLocation(
93 const gfx::PointF& location, int source_device_id) { 93 const gfx::PointF& location, int source_device_id) {
94 const int max_distance = 94 const float max_distance =
95 GestureConfiguration::max_separation_for_gesture_touches_in_pixels(); 95 GestureConfiguration::max_separation_for_gesture_touches_in_pixels();
96 96
97 gfx::PointF closest_point; 97 gfx::PointF closest_point;
98 int closest_touch_id = 0; 98 int closest_touch_id = 0;
99 float closest_distance_squared = std::numeric_limits<float>::infinity(); 99 float closest_distance_squared = std::numeric_limits<float>::infinity();
100 100
101 std::map<GestureConsumer*, GestureProviderAura*>::iterator i; 101 std::map<GestureConsumer*, GestureProviderAura*>::iterator i;
102 for (i = consumer_gesture_provider_.begin(); 102 for (i = consumer_gesture_provider_.begin();
103 i != consumer_gesture_provider_.end(); 103 i != consumer_gesture_provider_.end();
104 ++i) { 104 ++i) {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 std::vector<GestureEventHelper*>::iterator it; 339 std::vector<GestureEventHelper*>::iterator it;
340 for (it = helpers.begin(); it != helpers.end(); ++it) 340 for (it = helpers.begin(); it != helpers.end(); ++it)
341 gesture_recognizer->AddGestureEventHelper(*it); 341 gesture_recognizer->AddGestureEventHelper(*it);
342 342
343 helpers.clear(); 343 helpers.clear();
344 g_gesture_recognizer_instance = 344 g_gesture_recognizer_instance =
345 static_cast<GestureRecognizerImpl*>(gesture_recognizer); 345 static_cast<GestureRecognizerImpl*>(gesture_recognizer);
346 } 346 }
347 347
348 } // namespace ui 348 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698