| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 : window_(NULL), | 338 : window_(NULL), |
| 339 dispatcher_(dispatcher), | 339 dispatcher_(dispatcher), |
| 340 synchronous_ack_for_next_event_(AckState::PENDING) {} | 340 synchronous_ack_for_next_event_(AckState::PENDING) {} |
| 341 | 341 |
| 342 ~QueueTouchEventDelegate() override {} | 342 ~QueueTouchEventDelegate() override {} |
| 343 | 343 |
| 344 void OnTouchEvent(ui::TouchEvent* event) override { | 344 void OnTouchEvent(ui::TouchEvent* event) override { |
| 345 event->DisableSynchronousHandling(); | 345 event->DisableSynchronousHandling(); |
| 346 if (synchronous_ack_for_next_event_ != AckState::PENDING) { | 346 if (synchronous_ack_for_next_event_ != AckState::PENDING) { |
| 347 ui::GestureRecognizer::Get()->AckSyncTouchEvent( | 347 ui::GestureRecognizer::Get()->AckSyncTouchEvent( |
| 348 event->unique_event_id(), | 348 event->unique_touch_event_id(), |
| 349 synchronous_ack_for_next_event_ == AckState::CONSUMED | 349 synchronous_ack_for_next_event_ == AckState::CONSUMED |
| 350 ? ui::ER_CONSUMED | 350 ? ui::ER_CONSUMED |
| 351 : ui::ER_UNHANDLED, | 351 : ui::ER_UNHANDLED, |
| 352 window_); | 352 window_); |
| 353 synchronous_ack_for_next_event_ = AckState::PENDING; | 353 synchronous_ack_for_next_event_ = AckState::PENDING; |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 | 356 |
| 357 void ReceivedAck() { | 357 void ReceivedAck() { |
| 358 ReceivedAckImpl(false); | 358 ReceivedAckImpl(false); |
| (...skipping 4057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4416 // The synchronous ack is stuck behind the pending touch move. | 4416 // The synchronous ack is stuck behind the pending touch move. |
| 4417 EXPECT_0_EVENTS(delegate->events()); | 4417 EXPECT_0_EVENTS(delegate->events()); |
| 4418 | 4418 |
| 4419 delegate->ReceivedAck(); | 4419 delegate->ReceivedAck(); |
| 4420 EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE, | 4420 EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE, |
| 4421 ui::ET_GESTURE_SCROLL_UPDATE); | 4421 ui::ET_GESTURE_SCROLL_UPDATE); |
| 4422 } | 4422 } |
| 4423 | 4423 |
| 4424 } // namespace test | 4424 } // namespace test |
| 4425 } // namespace aura | 4425 } // namespace aura |
| OLD | NEW |