| 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_window_tree_client_factory.h" | 5 #include "content/renderer/mus/render_widget_window_tree_client_factory.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // ConnectionFilter implementation: | 52 // ConnectionFilter implementation: |
| 53 bool OnConnect(shell::Connection* connection, | 53 bool OnConnect(shell::Connection* connection, |
| 54 shell::Connector* connector) override { | 54 shell::Connector* connector) override { |
| 55 connection->AddInterface<mojom::RenderWidgetWindowTreeClientFactory>(this); | 55 connection->AddInterface<mojom::RenderWidgetWindowTreeClientFactory>(this); |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // shell::InterfaceFactory<mojom::RenderWidgetWindowTreeClientFactory>: | 59 // shell::InterfaceFactory<mojom::RenderWidgetWindowTreeClientFactory>: |
| 60 void Create(shell::Connection* connection, | 60 void Create(const shell::Identity& remote_identity, |
| 61 mojo::InterfaceRequest<mojom::RenderWidgetWindowTreeClientFactory> | 61 mojo::InterfaceRequest<mojom::RenderWidgetWindowTreeClientFactory> |
| 62 request) override { | 62 request) override { |
| 63 bindings_.AddBinding(this, std::move(request)); | 63 bindings_.AddBinding(this, std::move(request)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 // mojom::RenderWidgetWindowTreeClientFactory implementation. | 66 // mojom::RenderWidgetWindowTreeClientFactory implementation. |
| 67 void CreateWindowTreeClientForRenderWidget( | 67 void CreateWindowTreeClientForRenderWidget( |
| 68 uint32_t routing_id, | 68 uint32_t routing_id, |
| 69 ui::mojom::WindowTreeClientRequest request) override { | 69 ui::mojom::WindowTreeClientRequest request) override { |
| 70 main_thread_task_runner_->PostTask( | 70 main_thread_task_runner_->PostTask( |
| 71 FROM_HERE, base::Bind(&BindMusConnectionOnMainThread, routing_id, | 71 FROM_HERE, base::Bind(&BindMusConnectionOnMainThread, routing_id, |
| 72 base::Passed(&request))); | 72 base::Passed(&request))); |
| 73 } | 73 } |
| 74 | 74 |
| 75 scoped_refptr<base::SequencedTaskRunner> main_thread_task_runner_; | 75 scoped_refptr<base::SequencedTaskRunner> main_thread_task_runner_; |
| 76 mojo::BindingSet<mojom::RenderWidgetWindowTreeClientFactory> bindings_; | 76 mojo::BindingSet<mojom::RenderWidgetWindowTreeClientFactory> bindings_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(RenderWidgetWindowTreeClientFactoryImpl); | 78 DISALLOW_COPY_AND_ASSIGN(RenderWidgetWindowTreeClientFactoryImpl); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace | 81 } // namespace |
| 82 | 82 |
| 83 void CreateRenderWidgetWindowTreeClientFactory( | 83 void CreateRenderWidgetWindowTreeClientFactory( |
| 84 MojoShellConnection* connection) { | 84 MojoShellConnection* connection) { |
| 85 connection->AddConnectionFilter( | 85 connection->AddConnectionFilter( |
| 86 base::MakeUnique<RenderWidgetWindowTreeClientFactoryImpl>()); | 86 base::MakeUnique<RenderWidgetWindowTreeClientFactoryImpl>()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace content | 89 } // namespace content |
| OLD | NEW |