Chromium Code Reviews| 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/gesture_detection/gesture_event_data_packet.h" | 5 #include "ui/events/gesture_detection/gesture_event_data_packet.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/events/gesture_detection/motion_event.h" | 8 #include "ui/events/gesture_detection/motion_event.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 GestureEventDataPacket GestureEventDataPacket::FromTouchTimeout( | 104 GestureEventDataPacket GestureEventDataPacket::FromTouchTimeout( |
| 105 const GestureEventData& gesture) { | 105 const GestureEventData& gesture) { |
| 106 GestureEventDataPacket packet(gesture.time, TOUCH_TIMEOUT, | 106 GestureEventDataPacket packet(gesture.time, TOUCH_TIMEOUT, |
| 107 gfx::PointF(gesture.x, gesture.y), | 107 gfx::PointF(gesture.x, gesture.y), |
| 108 gfx::PointF(gesture.raw_x, gesture.raw_y), | 108 gfx::PointF(gesture.raw_x, gesture.raw_y), |
| 109 gesture.unique_touch_event_id); | 109 gesture.unique_touch_event_id); |
| 110 packet.Push(gesture); | 110 packet.Push(gesture); |
| 111 return packet; | 111 return packet; |
| 112 } | 112 } |
| 113 | 113 |
| 114 void GestureEventDataPacket::Ack(bool event_consumed) { | 114 void GestureEventDataPacket::Ack(EventResult result) { |
| 115 DCHECK_EQ(static_cast<int>(ack_state_), static_cast<int>(AckState::PENDING)); | 115 DCHECK_EQ(static_cast<int>(ack_state_), static_cast<int>(AckState::PENDING)); |
| 116 ack_state_ = event_consumed ? AckState::CONSUMED : AckState::UNCONSUMED; | 116 ack_state_ = (result == ER_UNHANDLED || result == ER_IGNORED_NON_BLOCKING) |
|
dtapuska
2017/05/25 15:40:12
I think these are bit sets.. so comparing them dir
| |
| 117 ? AckState::UNCONSUMED | |
| 118 : AckState::CONSUMED; | |
| 119 for (auto& gesture : gestures_.container()) | |
| 120 gesture.details.set_source_touch_event_result(result); | |
| 117 } | 121 } |
| 118 | 122 |
| 119 } // namespace ui | 123 } // namespace ui |
| OLD | NEW |