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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return false; | 146 return false; |
147 } | 147 } |
148 | 148 |
149 void RenderWidgetMusConnection::OnConnectionLost() { | 149 void RenderWidgetMusConnection::OnConnectionLost() { |
150 DCHECK(thread_checker_.CalledOnValidThread()); | 150 DCHECK(thread_checker_.CalledOnValidThread()); |
151 g_connections.Get().erase(routing_id_); | 151 g_connections.Get().erase(routing_id_); |
152 delete this; | 152 delete this; |
153 } | 153 } |
154 | 154 |
155 void RenderWidgetMusConnection::OnWindowInputEvent( | 155 void RenderWidgetMusConnection::OnWindowInputEvent( |
156 std::unique_ptr<blink::WebInputEvent> input_event, | 156 ui::ScopedWebInputEvent input_event, |
157 const base::Callback<void(ui::mojom::EventResult)>& ack) { | 157 const base::Callback<void(ui::mojom::EventResult)>& ack) { |
158 DCHECK(thread_checker_.CalledOnValidThread()); | 158 DCHECK(thread_checker_.CalledOnValidThread()); |
159 // If we don't yet have a RenderWidgetInputHandler then we don't yet have | 159 // If we don't yet have a RenderWidgetInputHandler then we don't yet have |
160 // an initialized RenderWidget. | 160 // an initialized RenderWidget. |
161 if (!input_handler_) { | 161 if (!input_handler_) { |
162 ack.Run(ui::mojom::EventResult::UNHANDLED); | 162 ack.Run(ui::mojom::EventResult::UNHANDLED); |
163 return; | 163 return; |
164 } | 164 } |
165 // TODO(fsamuel): It would be nice to add this DCHECK but the reality is an | 165 // TODO(fsamuel): It would be nice to add this DCHECK but the reality is an |
166 // event could timeout and we could receive the next event before we ack the | 166 // event could timeout and we could receive the next event before we ack the |
167 // previous event. | 167 // previous event. |
168 // DCHECK(pending_ack_.is_null()); | 168 // DCHECK(pending_ack_.is_null()); |
169 pending_ack_ = ack; | 169 pending_ack_ = ack; |
170 // TODO(fsamuel, sadrul): Track real latency info. | 170 // TODO(fsamuel, sadrul): Track real latency info. |
171 ui::LatencyInfo latency_info; | 171 ui::LatencyInfo latency_info; |
172 input_handler_->HandleInputEvent(*input_event, latency_info, | 172 input_handler_->HandleInputEvent(*input_event, latency_info, |
173 DISPATCH_TYPE_BLOCKING); | 173 DISPATCH_TYPE_BLOCKING); |
174 } | 174 } |
175 | 175 |
176 } // namespace content | 176 } // namespace content |
OLD | NEW |