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/render_widget_window_tree_client_factory.h" | 5 #include "content/renderer/render_widget_window_tree_client_factory.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/mus/public/interfaces/window_tree.mojom.h" | 9 #include "components/mus/public/interfaces/window_tree.mojom.h" |
10 #include "content/common/render_widget_window_tree_client_factory.mojom.h" | 10 #include "content/common/render_widget_window_tree_client_factory.mojom.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 void Create(mojo::ApplicationConnection* connection, | 45 void Create(mojo::ApplicationConnection* connection, |
46 mojo::InterfaceRequest<mojom::RenderWidgetWindowTreeClientFactory> | 46 mojo::InterfaceRequest<mojom::RenderWidgetWindowTreeClientFactory> |
47 request) override { | 47 request) override { |
48 bindings_.AddBinding(this, request.Pass()); | 48 bindings_.AddBinding(this, request.Pass()); |
49 } | 49 } |
50 | 50 |
51 // mojom::RenderWidgetWindowTreeClientFactory implementation. | 51 // mojom::RenderWidgetWindowTreeClientFactory implementation. |
52 void CreateWindowTreeClientForRenderWidget( | 52 void CreateWindowTreeClientForRenderWidget( |
53 uint32_t routing_id, | 53 uint32_t routing_id, |
54 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request) override { | 54 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request) override { |
55 new RenderWidgetMusConnection(routing_id, request.Pass()); | 55 RenderWidgetMusConnection* connection = |
| 56 RenderWidgetMusConnection::GetOrCreate(routing_id); |
| 57 connection->Bind(request.Pass()); |
56 } | 58 } |
57 | 59 |
58 mojo::WeakBindingSet<mojom::RenderWidgetWindowTreeClientFactory> bindings_; | 60 mojo::WeakBindingSet<mojom::RenderWidgetWindowTreeClientFactory> bindings_; |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(RenderWidgetWindowTreeClientFactoryImpl); | 62 DISALLOW_COPY_AND_ASSIGN(RenderWidgetWindowTreeClientFactoryImpl); |
61 }; | 63 }; |
62 | 64 |
63 } // namespace | 65 } // namespace |
64 | 66 |
65 void CreateRenderWidgetWindowTreeClientFactory() { | 67 void CreateRenderWidgetWindowTreeClientFactory() { |
66 new RenderWidgetWindowTreeClientFactoryImpl; | 68 new RenderWidgetWindowTreeClientFactoryImpl; |
67 } | 69 } |
68 | 70 |
69 } // namespace content | 71 } // namespace content |
OLD | NEW |