Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ | 5 #ifndef UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ |
| 6 #define UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ | 6 #define UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "ui/events/blink/input_handler_proxy.h" | 10 #include "ui/events/blink/input_handler_proxy.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 std::unique_ptr<DidOverscrollParams>); | 48 std::unique_ptr<DidOverscrollParams>); |
| 49 | 49 |
| 50 const blink::WebInputEvent& event() const { return *event_; } | 50 const blink::WebInputEvent& event() const { return *event_; } |
| 51 const LatencyInfo latency_info() const { return latency_; } | 51 const LatencyInfo latency_info() const { return latency_; } |
| 52 base::TimeTicks creation_timestamp() const { return creation_timestamp_; } | 52 base::TimeTicks creation_timestamp() const { return creation_timestamp_; } |
| 53 base::TimeTicks last_coalesced_timestamp() const { | 53 base::TimeTicks last_coalesced_timestamp() const { |
| 54 return last_coalesced_timestamp_; | 54 return last_coalesced_timestamp_; |
| 55 } | 55 } |
| 56 size_t coalesced_count() const { return original_events_.size(); } | 56 size_t coalesced_count() const { return original_events_.size(); } |
| 57 OriginalEventList& original_events() { return original_events_; } | 57 OriginalEventList& original_events() { return original_events_; } |
| 58 blink::WebInputEvent* first_original_event() { | |
|
tdresser
2017/02/16 13:44:18
Can't we just use coalesced_count(), instead of ad
chongz
2017/02/16 15:08:58
Added comments.
// |first_original_event()| is us
| |
| 59 return original_events_.empty() ? nullptr | |
| 60 : original_events_.front().event_.get(); | |
| 61 } | |
| 58 | 62 |
| 59 private: | 63 private: |
| 60 friend class test::InputHandlerProxyEventQueueTest; | 64 friend class test::InputHandlerProxyEventQueueTest; |
| 61 | 65 |
| 62 void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock); | 66 void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock); |
| 63 | 67 |
| 64 WebScopedInputEvent event_; | 68 WebScopedInputEvent event_; |
| 65 LatencyInfo latency_; | 69 LatencyInfo latency_; |
| 66 OriginalEventList original_events_; | 70 OriginalEventList original_events_; |
| 67 | 71 |
| 68 base::TimeTicks creation_timestamp_; | 72 base::TimeTicks creation_timestamp_; |
| 69 base::TimeTicks last_coalesced_timestamp_; | 73 base::TimeTicks last_coalesced_timestamp_; |
| 70 }; | 74 }; |
| 71 | 75 |
| 72 } // namespace ui | 76 } // namespace ui |
| 73 | 77 |
| 74 #endif // UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ | 78 #endif // UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ |
| OLD | NEW |