| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ |
| 6 #define CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ | 6 #define CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" | 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "services/ui/common/types.h" | 10 #include "services/ui/common/types.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class WindowCompositorFrameSinkBinding; | 23 class WindowCompositorFrameSinkBinding; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| 27 | 27 |
| 28 // ui.mojom.WindowTreeClient implementation for RenderWidget. This lives and | 28 // ui.mojom.WindowTreeClient implementation for RenderWidget. This lives and |
| 29 // operates on the renderer's main thread. | 29 // operates on the renderer's main thread. |
| 30 class RendererWindowTreeClient : public ui::mojom::WindowTreeClient { | 30 class RendererWindowTreeClient : public ui::mojom::WindowTreeClient { |
| 31 public: | 31 public: |
| 32 // Creates a RendererWindowTreeClient instance for the RenderWidget instance | 32 // Creates a RendererWindowTreeClient instance for the RenderWidget instance |
| 33 // associated with |routing_id|. The instance self-destructs when the | 33 // associated with |routing_id| (if one doesn't already exist). The instance |
| 34 // connection to mus is lost, or when the window is closed. | 34 // self-destructs when the connection to mus is lost, or when the window is |
| 35 static void Create(int routing_id); | 35 // closed. |
| 36 static void CreateIfNecessary(int routing_id); |
| 36 | 37 |
| 37 // Destroys the client instance, if one exists. Otherwise, does nothing. | 38 // Destroys the client instance, if one exists. Otherwise, does nothing. |
| 38 static void Destroy(int routing_id); | 39 static void Destroy(int routing_id); |
| 39 | 40 |
| 40 // Returns the RendererWindowTreeClient associated with |routing_id|. Returns | 41 // Returns the RendererWindowTreeClient associated with |routing_id|. Returns |
| 41 // nullptr if none exists. | 42 // nullptr if none exists. |
| 42 static RendererWindowTreeClient* Get(int routing_id); | 43 static RendererWindowTreeClient* Get(int routing_id); |
| 43 | 44 |
| 44 void Bind(ui::mojom::WindowTreeClientRequest request); | 45 void Bind(ui::mojom::WindowTreeClientRequest request); |
| 45 | 46 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 ui::mojom::WindowTreePtr tree_; | 148 ui::mojom::WindowTreePtr tree_; |
| 148 std::unique_ptr<ui::WindowCompositorFrameSinkBinding> pending_frame_sink_; | 149 std::unique_ptr<ui::WindowCompositorFrameSinkBinding> pending_frame_sink_; |
| 149 mojo::Binding<ui::mojom::WindowTreeClient> binding_; | 150 mojo::Binding<ui::mojom::WindowTreeClient> binding_; |
| 150 | 151 |
| 151 DISALLOW_COPY_AND_ASSIGN(RendererWindowTreeClient); | 152 DISALLOW_COPY_AND_ASSIGN(RendererWindowTreeClient); |
| 152 }; | 153 }; |
| 153 | 154 |
| 154 } // namespace content | 155 } // namespace content |
| 155 | 156 |
| 156 #endif // CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ | 157 #endif // CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ |
| OLD | NEW |