| 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/compositor_mus_connection.h" | 5 #include "content/renderer/mus/compositor_mus_connection.h" |
| 6 | 6 |
| 7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
| 8 #include "content/common/input/web_input_event_traits.h" | 8 #include "content/common/input/web_input_event_traits.h" |
| 9 #include "content/renderer/input/input_handler_manager.h" | 9 #include "content/renderer/input/input_handler_manager.h" |
| 10 #include "content/renderer/mus/render_widget_mus_connection.h" | 10 #include "content/renderer/mus/render_widget_mus_connection.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 void CompositorMusConnection::OnEmbed(mus::Window* root) { | 109 void CompositorMusConnection::OnEmbed(mus::Window* root) { |
| 110 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 110 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
| 111 root_ = root; | 111 root_ = root; |
| 112 root_->set_input_event_handler(this); | 112 root_->set_input_event_handler(this); |
| 113 if (window_surface_binding_) { | 113 if (window_surface_binding_) { |
| 114 root->AttachSurface(mus::mojom::SurfaceType::DEFAULT, | 114 root->AttachSurface(mus::mojom::SurfaceType::DEFAULT, |
| 115 std::move(window_surface_binding_)); | 115 std::move(window_surface_binding_)); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 void CompositorMusConnection::OnEventObserved(const ui::Event& event) { |
| 120 // Compositor does not use SetEventObserver(). |
| 121 } |
| 122 |
| 119 void CompositorMusConnection::OnWindowInputEvent( | 123 void CompositorMusConnection::OnWindowInputEvent( |
| 120 mus::Window* window, | 124 mus::Window* window, |
| 121 const ui::Event& event, | 125 const ui::Event& event, |
| 122 std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) { | 126 std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) { |
| 123 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 127 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
| 124 // TODO(moshayedi): Convert ui::Event directly to blink::WebInputEvent. | 128 // TODO(moshayedi): Convert ui::Event directly to blink::WebInputEvent. |
| 125 std::unique_ptr<blink::WebInputEvent> web_event( | 129 std::unique_ptr<blink::WebInputEvent> web_event( |
| 126 mus::mojom::Event::From(event) | 130 mus::mojom::Event::From(event) |
| 127 .To<std::unique_ptr<blink::WebInputEvent>>()); | 131 .To<std::unique_ptr<blink::WebInputEvent>>()); |
| 128 // TODO(sad): We probably need to plumb LatencyInfo through Mus. | 132 // TODO(sad): We probably need to plumb LatencyInfo through Mus. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 146 this, *ack_callback->get()); | 150 this, *ack_callback->get()); |
| 147 ack_callback->reset(); | 151 ack_callback->reset(); |
| 148 } | 152 } |
| 149 main_task_runner_->PostTask( | 153 main_task_runner_->PostTask( |
| 150 FROM_HERE, | 154 FROM_HERE, |
| 151 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, | 155 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, |
| 152 base::Passed(std::move(web_event)), ack)); | 156 base::Passed(std::move(web_event)), ack)); |
| 153 } | 157 } |
| 154 | 158 |
| 155 } // namespace content | 159 } // namespace content |
| OLD | NEW |