OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/mus/render_widget_mus_connection.h" | 5 #include "content/renderer/mus/render_widget_mus_connection.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 return false; | 149 return false; |
150 } | 150 } |
151 | 151 |
152 void RenderWidgetMusConnection::OnConnectionLost() { | 152 void RenderWidgetMusConnection::OnConnectionLost() { |
153 DCHECK(thread_checker_.CalledOnValidThread()); | 153 DCHECK(thread_checker_.CalledOnValidThread()); |
154 g_connections.Get().erase(routing_id_); | 154 g_connections.Get().erase(routing_id_); |
155 delete this; | 155 delete this; |
156 } | 156 } |
157 | 157 |
158 void RenderWidgetMusConnection::OnWindowInputEvent( | 158 void RenderWidgetMusConnection::OnWindowInputEvent( |
159 ui::ScopedWebInputEvent input_event, | 159 blink::ScopedCoalescedWebInputEvent input_event, |
160 const base::Callback<void(ui::mojom::EventResult)>& ack) { | 160 const base::Callback<void(ui::mojom::EventResult)>& ack) { |
161 DCHECK(thread_checker_.CalledOnValidThread()); | 161 DCHECK(thread_checker_.CalledOnValidThread()); |
162 // If we don't yet have a RenderWidgetInputHandler then we don't yet have | 162 // If we don't yet have a RenderWidgetInputHandler then we don't yet have |
163 // an initialized RenderWidget. | 163 // an initialized RenderWidget. |
164 if (!input_handler_) { | 164 if (!input_handler_) { |
165 ack.Run(ui::mojom::EventResult::UNHANDLED); | 165 ack.Run(ui::mojom::EventResult::UNHANDLED); |
166 return; | 166 return; |
167 } | 167 } |
168 // TODO(fsamuel): It would be nice to add this DCHECK but the reality is an | 168 // TODO(fsamuel): It would be nice to add this DCHECK but the reality is an |
169 // event could timeout and we could receive the next event before we ack the | 169 // event could timeout and we could receive the next event before we ack the |
170 // previous event. | 170 // previous event. |
171 // DCHECK(pending_ack_.is_null()); | 171 // DCHECK(pending_ack_.is_null()); |
172 pending_ack_ = ack; | 172 pending_ack_ = ack; |
173 // TODO(fsamuel, sadrul): Track real latency info. | 173 // TODO(fsamuel, sadrul): Track real latency info. |
174 ui::LatencyInfo latency_info; | 174 ui::LatencyInfo latency_info; |
175 input_handler_->HandleInputEvent(*input_event, latency_info, | 175 input_handler_->HandleInputEvent(*input_event, latency_info, |
176 DISPATCH_TYPE_BLOCKING); | 176 DISPATCH_TYPE_BLOCKING); |
177 } | 177 } |
178 | 178 |
179 } // namespace content | 179 } // namespace content |
OLD | NEW |