| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |