OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/renderer_host/input/synthetic_gesture_controller.h" | 5 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool was_empty = pending_gesture_queue_.IsEmpty(); | 28 bool was_empty = pending_gesture_queue_.IsEmpty(); |
29 | 29 |
30 pending_gesture_queue_.Push(std::move(synthetic_gesture), | 30 pending_gesture_queue_.Push(std::move(synthetic_gesture), |
31 completion_callback); | 31 completion_callback); |
32 | 32 |
33 if (was_empty) | 33 if (was_empty) |
34 StartGesture(*pending_gesture_queue_.FrontGesture()); | 34 StartGesture(*pending_gesture_queue_.FrontGesture()); |
35 } | 35 } |
36 | 36 |
37 void SyntheticGestureController::Flush(base::TimeTicks timestamp) { | 37 void SyntheticGestureController::Flush(base::TimeTicks timestamp) { |
| 38 LOG(ERROR) << "SyntheticGestureController::Flush " |
| 39 << pending_gesture_queue_.IsEmpty(); |
38 TRACE_EVENT0("input", "SyntheticGestureController::Flush"); | 40 TRACE_EVENT0("input", "SyntheticGestureController::Flush"); |
39 if (pending_gesture_queue_.IsEmpty()) | 41 if (pending_gesture_queue_.IsEmpty()) |
40 return; | 42 return; |
41 | 43 |
42 if (pending_gesture_result_) | 44 if (pending_gesture_result_) |
43 return; | 45 return; |
44 | 46 |
45 SyntheticGesture* gesture = pending_gesture_queue_.FrontGesture(); | 47 SyntheticGesture* gesture = pending_gesture_queue_.FrontGesture(); |
46 SyntheticGesture::Result result = | 48 SyntheticGesture::Result result = |
47 gesture->ForwardInputEvents(timestamp, gesture_target_.get()); | 49 gesture->ForwardInputEvents(timestamp, gesture_target_.get()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const OnGestureCompleteCallback& completion_callback, | 88 const OnGestureCompleteCallback& completion_callback, |
87 SyntheticGesture::Result result) { | 89 SyntheticGesture::Result result) { |
88 DCHECK_NE(result, SyntheticGesture::GESTURE_RUNNING); | 90 DCHECK_NE(result, SyntheticGesture::GESTURE_RUNNING); |
89 TRACE_EVENT_ASYNC_END0("input,benchmark", | 91 TRACE_EVENT_ASYNC_END0("input,benchmark", |
90 "SyntheticGestureController::running", | 92 "SyntheticGestureController::running", |
91 &gesture); | 93 &gesture); |
92 | 94 |
93 completion_callback.Run(result); | 95 completion_callback.Run(result); |
94 } | 96 } |
95 | 97 |
| 98 SyntheticGestureParams::GestureSourceType |
| 99 SyntheticGestureController::GetDefaultSyntheticGestureSourceType() { |
| 100 return gesture_target_->GetDefaultSyntheticGestureSourceType(); |
| 101 } |
| 102 |
96 SyntheticGestureController::GestureAndCallbackQueue::GestureAndCallbackQueue() { | 103 SyntheticGestureController::GestureAndCallbackQueue::GestureAndCallbackQueue() { |
97 } | 104 } |
98 | 105 |
99 SyntheticGestureController::GestureAndCallbackQueue:: | 106 SyntheticGestureController::GestureAndCallbackQueue:: |
100 ~GestureAndCallbackQueue() { | 107 ~GestureAndCallbackQueue() { |
101 } | 108 } |
102 | 109 |
103 } // namespace content | 110 } // namespace content |
OLD | NEW |