| 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) { | 119 void CompositorMusConnection::OnEventObserved(const ui::Event& event, |
| 120 mus::Window* target) { |
| 120 // Compositor does not use SetEventObserver(). | 121 // Compositor does not use SetEventObserver(). |
| 121 } | 122 } |
| 122 | 123 |
| 123 void CompositorMusConnection::OnWindowInputEvent( | 124 void CompositorMusConnection::OnWindowInputEvent( |
| 124 mus::Window* window, | 125 mus::Window* window, |
| 125 const ui::Event& event, | 126 const ui::Event& event, |
| 126 std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) { | 127 std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) { |
| 127 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 128 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
| 128 // TODO(moshayedi): Convert ui::Event directly to blink::WebInputEvent. | 129 // TODO(moshayedi): Convert ui::Event directly to blink::WebInputEvent. |
| 129 std::unique_ptr<blink::WebInputEvent> web_event( | 130 std::unique_ptr<blink::WebInputEvent> web_event( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 150 this, *ack_callback->get()); | 151 this, *ack_callback->get()); |
| 151 ack_callback->reset(); | 152 ack_callback->reset(); |
| 152 } | 153 } |
| 153 main_task_runner_->PostTask( | 154 main_task_runner_->PostTask( |
| 154 FROM_HERE, | 155 FROM_HERE, |
| 155 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, | 156 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, |
| 156 base::Passed(std::move(web_event)), ack)); | 157 base::Passed(std::move(web_event)), ack)); |
| 157 } | 158 } |
| 158 | 159 |
| 159 } // namespace content | 160 } // namespace content |
| OLD | NEW |