| 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 16 matching lines...) Expand all Loading... |
| 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|. The instance self-destructs when the |
| 34 // connection to mus is lost, or when the window is closed. | 34 // connection to mus is lost, or when the window is closed. |
| 35 static void Create(int routing_id); | 35 static void Create(int routing_id); |
| 36 | 36 |
| 37 // Destroys the client instance, if one exists. Otherwise, does nothing. |
| 38 static void Destroy(int routing_id); |
| 39 |
| 37 // Returns the RendererWindowTreeClient associated with |routing_id|. Returns | 40 // Returns the RendererWindowTreeClient associated with |routing_id|. Returns |
| 38 // nullptr if none exists. | 41 // nullptr if none exists. |
| 39 static RendererWindowTreeClient* Get(int routing_id); | 42 static RendererWindowTreeClient* Get(int routing_id); |
| 40 | 43 |
| 41 void Bind(ui::mojom::WindowTreeClientRequest request); | 44 void Bind(ui::mojom::WindowTreeClientRequest request); |
| 42 | 45 |
| 43 std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink( | 46 std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink( |
| 44 const cc::FrameSinkId& frame_sink_id, | 47 const cc::FrameSinkId& frame_sink_id, |
| 45 scoped_refptr<cc::ContextProvider> context_provider, | 48 scoped_refptr<cc::ContextProvider> context_provider, |
| 46 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); | 49 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 ui::mojom::WindowTreePtr tree_; | 147 ui::mojom::WindowTreePtr tree_; |
| 145 std::unique_ptr<ui::WindowCompositorFrameSinkBinding> pending_frame_sink_; | 148 std::unique_ptr<ui::WindowCompositorFrameSinkBinding> pending_frame_sink_; |
| 146 mojo::Binding<ui::mojom::WindowTreeClient> binding_; | 149 mojo::Binding<ui::mojom::WindowTreeClient> binding_; |
| 147 | 150 |
| 148 DISALLOW_COPY_AND_ASSIGN(RendererWindowTreeClient); | 151 DISALLOW_COPY_AND_ASSIGN(RendererWindowTreeClient); |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 } // namespace content | 154 } // namespace content |
| 152 | 155 |
| 153 #endif // CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ | 156 #endif // CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ |
| OLD | NEW |