| 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 29 matching lines...) Expand all Loading... |
| 40 this, base::Passed(std::move(surface_binding)))); | 40 this, base::Passed(std::move(surface_binding)))); |
| 41 } | 41 } |
| 42 | 42 |
| 43 CompositorMusConnection::~CompositorMusConnection() {} | 43 CompositorMusConnection::~CompositorMusConnection() {} |
| 44 | 44 |
| 45 void CompositorMusConnection::AttachSurfaceOnCompositorThread( | 45 void CompositorMusConnection::AttachSurfaceOnCompositorThread( |
| 46 scoped_ptr<mus::WindowSurfaceBinding> surface_binding) { | 46 scoped_ptr<mus::WindowSurfaceBinding> surface_binding) { |
| 47 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 47 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
| 48 window_surface_binding_ = std::move(surface_binding); | 48 window_surface_binding_ = std::move(surface_binding); |
| 49 if (root_) { | 49 if (root_) { |
| 50 root_->AttachSurface(mus::mojom::SURFACE_TYPE_DEFAULT, | 50 root_->AttachSurface(mus::mojom::SurfaceType::DEFAULT, |
| 51 std::move(window_surface_binding_)); | 51 std::move(window_surface_binding_)); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 void CompositorMusConnection::CreateWindowTreeConnectionOnCompositorThread( | 55 void CompositorMusConnection::CreateWindowTreeConnectionOnCompositorThread( |
| 56 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request) { | 56 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request) { |
| 57 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 57 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
| 58 mus::WindowTreeConnection::Create( | 58 mus::WindowTreeConnection::Create( |
| 59 this, std::move(request), | 59 this, std::move(request), |
| 60 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED); | 60 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 main_task_runner_->PostTask( | 94 main_task_runner_->PostTask( |
| 95 FROM_HERE, | 95 FROM_HERE, |
| 96 base::Bind(&CompositorMusConnection::OnConnectionLostOnMainThread, this)); | 96 base::Bind(&CompositorMusConnection::OnConnectionLostOnMainThread, this)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void CompositorMusConnection::OnEmbed(mus::Window* root) { | 99 void CompositorMusConnection::OnEmbed(mus::Window* root) { |
| 100 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 100 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
| 101 root_ = root; | 101 root_ = root; |
| 102 root_->set_input_event_handler(this); | 102 root_->set_input_event_handler(this); |
| 103 if (window_surface_binding_) { | 103 if (window_surface_binding_) { |
| 104 root->AttachSurface(mus::mojom::SURFACE_TYPE_DEFAULT, | 104 root->AttachSurface(mus::mojom::SurfaceType::DEFAULT, |
| 105 std::move(window_surface_binding_)); | 105 std::move(window_surface_binding_)); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 void CompositorMusConnection::OnWindowInputEvent( | 109 void CompositorMusConnection::OnWindowInputEvent( |
| 110 mus::Window* window, | 110 mus::Window* window, |
| 111 mus::mojom::EventPtr event, | 111 mus::mojom::EventPtr event, |
| 112 scoped_ptr<base::Closure>* ack_callback) { | 112 scoped_ptr<base::Closure>* ack_callback) { |
| 113 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 113 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
| 114 scoped_ptr<blink::WebInputEvent> web_event = | 114 scoped_ptr<blink::WebInputEvent> web_event = |
| (...skipping 17 matching lines...) Expand all Loading... |
| 132 this, *ack_callback->get()); | 132 this, *ack_callback->get()); |
| 133 ack_callback->reset(); | 133 ack_callback->reset(); |
| 134 } | 134 } |
| 135 main_task_runner_->PostTask( | 135 main_task_runner_->PostTask( |
| 136 FROM_HERE, | 136 FROM_HERE, |
| 137 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, | 137 base::Bind(&CompositorMusConnection::OnWindowInputEventOnMainThread, this, |
| 138 base::Passed(std::move(web_event)), ack)); | 138 base::Passed(std::move(web_event)), ack)); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace content | 141 } // namespace content |
| OLD | NEW |