| OLD | NEW |
| 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 #include "ui/events/gestures/gesture_provider_aura.h" | 5 #include "ui/events/gestures/gesture_provider_aura.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 auto result = filtered_gesture_provider_.OnTouchEvent(pointer_state_); | 36 auto result = filtered_gesture_provider_.OnTouchEvent(pointer_state_); |
| 37 if (!result.succeeded) | 37 if (!result.succeeded) |
| 38 return false; | 38 return false; |
| 39 | 39 |
| 40 event->set_may_cause_scrolling(result.moved_beyond_slop_region); | 40 event->set_may_cause_scrolling(result.moved_beyond_slop_region); |
| 41 pointer_state_.CleanupRemovedTouchPoints(*event); | 41 pointer_state_.CleanupRemovedTouchPoints(*event); |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 void GestureProviderAura::OnTouchEventAck(uint32_t unique_touch_event_id, | 45 void GestureProviderAura::OnTouchEventAck( |
| 46 bool event_consumed) { | 46 uint32_t unique_touch_event_id, |
| 47 bool event_consumed, |
| 48 bool is_source_touch_event_set_non_blocking) { |
| 47 DCHECK(pending_gestures_.empty()); | 49 DCHECK(pending_gestures_.empty()); |
| 48 DCHECK(!handling_event_); | 50 DCHECK(!handling_event_); |
| 49 base::AutoReset<bool> handling_event(&handling_event_, true); | 51 base::AutoReset<bool> handling_event(&handling_event_, true); |
| 50 filtered_gesture_provider_.OnTouchEventAck(unique_touch_event_id, | 52 filtered_gesture_provider_.OnTouchEventAck( |
| 51 event_consumed); | 53 unique_touch_event_id, event_consumed, |
| 54 is_source_touch_event_set_non_blocking); |
| 52 } | 55 } |
| 53 | 56 |
| 54 void GestureProviderAura::OnGestureEvent(const GestureEventData& gesture) { | 57 void GestureProviderAura::OnGestureEvent(const GestureEventData& gesture) { |
| 55 std::unique_ptr<ui::GestureEvent> event( | 58 std::unique_ptr<ui::GestureEvent> event( |
| 56 new ui::GestureEvent(gesture.x, gesture.y, gesture.flags, | 59 new ui::GestureEvent(gesture.x, gesture.y, gesture.flags, |
| 57 gesture.time, gesture.details, | 60 gesture.time, gesture.details, |
| 58 gesture.unique_touch_event_id)); | 61 gesture.unique_touch_event_id)); |
| 59 | 62 |
| 60 if (!handling_event_) { | 63 if (!handling_event_) { |
| 61 // Dispatching event caused by timer. | 64 // Dispatching event caused by timer. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 75 void GestureProviderAura::OnTouchEnter(int pointer_id, float x, float y) { | 78 void GestureProviderAura::OnTouchEnter(int pointer_id, float x, float y) { |
| 76 std::unique_ptr<TouchEvent> touch_event(new TouchEvent( | 79 std::unique_ptr<TouchEvent> touch_event(new TouchEvent( |
| 77 ET_TOUCH_PRESSED, gfx::Point(), ui::EventTimeForNow(), | 80 ET_TOUCH_PRESSED, gfx::Point(), ui::EventTimeForNow(), |
| 78 PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, pointer_id), | 81 PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, pointer_id), |
| 79 EF_IS_SYNTHESIZED, 0.0f)); | 82 EF_IS_SYNTHESIZED, 0.0f)); |
| 80 gfx::PointF point(x, y); | 83 gfx::PointF point(x, y); |
| 81 touch_event->set_location_f(point); | 84 touch_event->set_location_f(point); |
| 82 touch_event->set_root_location_f(point); | 85 touch_event->set_root_location_f(point); |
| 83 | 86 |
| 84 OnTouchEvent(touch_event.get()); | 87 OnTouchEvent(touch_event.get()); |
| 85 OnTouchEventAck(touch_event->unique_event_id(), true); | 88 OnTouchEventAck(touch_event->unique_event_id(), true /* event_consumed */, |
| 89 false /* is_source_touch_event_set_non_blocking */); |
| 86 } | 90 } |
| 87 | 91 |
| 88 } // namespace content | 92 } // namespace content |
| OLD | NEW |