| 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" |
| 11 #include "services/ui/public/cpp/client_compositor_frame_sink.h" |
| 11 #include "services/ui/public/interfaces/window_tree.mojom.h" | 12 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 12 | 13 |
| 13 namespace cc { | 14 namespace cc { |
| 14 class CompositorFrameSink; | 15 class CompositorFrameSink; |
| 15 class ContextProvider; | 16 class ContextProvider; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace gpu { | 19 namespace gpu { |
| 19 class GpuMemoryBufferManager; | 20 class GpuMemoryBufferManager; |
| 20 } | 21 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 // closed. | 32 // closed. |
| 32 static void CreateIfNecessary(int routing_id); | 33 static void CreateIfNecessary(int routing_id); |
| 33 | 34 |
| 34 // Destroys the client instance, if one exists. Otherwise, does nothing. | 35 // Destroys the client instance, if one exists. Otherwise, does nothing. |
| 35 static void Destroy(int routing_id); | 36 static void Destroy(int routing_id); |
| 36 | 37 |
| 37 // Returns the RendererWindowTreeClient associated with |routing_id|. Returns | 38 // Returns the RendererWindowTreeClient associated with |routing_id|. Returns |
| 38 // nullptr if none exists. | 39 // nullptr if none exists. |
| 39 static RendererWindowTreeClient* Get(int routing_id); | 40 static RendererWindowTreeClient* Get(int routing_id); |
| 40 | 41 |
| 42 const cc::LocalSurfaceId& local_surface_id() const { |
| 43 return current_local_surface_id_; |
| 44 } |
| 45 |
| 41 void Bind(ui::mojom::WindowTreeClientRequest request); | 46 void Bind(ui::mojom::WindowTreeClientRequest request); |
| 42 | 47 |
| 43 using CompositorFrameSinkCallback = | 48 using CompositorFrameSinkCallback = |
| 44 base::Callback<void(std::unique_ptr<cc::CompositorFrameSink>)>; | 49 base::Callback<void(std::unique_ptr<cc::CompositorFrameSink>)>; |
| 45 void RequestCompositorFrameSink( | 50 void RequestCompositorFrameSink( |
| 46 scoped_refptr<cc::ContextProvider> context_provider, | 51 scoped_refptr<cc::ContextProvider> context_provider, |
| 47 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 52 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 48 const CompositorFrameSinkCallback& callback); | 53 const CompositorFrameSinkCallback& callback); |
| 49 | 54 |
| 50 private: | 55 private: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void OnDragLeave(ui::Id window_id) override; | 146 void OnDragLeave(ui::Id window_id) override; |
| 142 void OnCompleteDrop(ui::Id window_id, | 147 void OnCompleteDrop(ui::Id window_id, |
| 143 uint32_t event_flags, | 148 uint32_t event_flags, |
| 144 const gfx::Point& position, | 149 const gfx::Point& position, |
| 145 uint32_t effect_bitmask, | 150 uint32_t effect_bitmask, |
| 146 const OnCompleteDropCallback& callback) override; | 151 const OnCompleteDropCallback& callback) override; |
| 147 void OnPerformDragDropCompleted(uint32_t window, | 152 void OnPerformDragDropCompleted(uint32_t window, |
| 148 bool success, | 153 bool success, |
| 149 uint32_t action_taken) override; | 154 uint32_t action_taken) override; |
| 150 void OnDragDropDone() override; | 155 void OnDragDropDone() override; |
| 156 void OnSetWindowBoundsResponse( |
| 157 uint32_t change_id, |
| 158 const gfx::Rect& bounds, |
| 159 const cc::LocalSurfaceId& local_surface_id) override; |
| 151 void OnChangeCompleted(uint32_t change_id, bool success) override; | 160 void OnChangeCompleted(uint32_t change_id, bool success) override; |
| 152 void RequestClose(uint32_t window_id) override; | 161 void RequestClose(uint32_t window_id) override; |
| 153 void GetWindowManager( | 162 void GetWindowManager( |
| 154 mojo::AssociatedInterfaceRequest<ui::mojom::WindowManager> internal) | 163 mojo::AssociatedInterfaceRequest<ui::mojom::WindowManager> internal) |
| 155 override; | 164 override; |
| 156 | 165 |
| 157 const int routing_id_; | 166 const int routing_id_; |
| 158 ui::Id root_window_id_; | 167 ui::Id root_window_id_; |
| 159 cc::FrameSinkId frame_sink_id_; | 168 cc::FrameSinkId frame_sink_id_; |
| 160 scoped_refptr<cc::ContextProvider> pending_context_provider_; | 169 scoped_refptr<cc::ContextProvider> pending_context_provider_; |
| 161 gpu::GpuMemoryBufferManager* pending_gpu_memory_buffer_manager_ = nullptr; | 170 gpu::GpuMemoryBufferManager* pending_gpu_memory_buffer_manager_ = nullptr; |
| 162 CompositorFrameSinkCallback pending_compositor_frame_sink_callback_; | 171 CompositorFrameSinkCallback pending_compositor_frame_sink_callback_; |
| 163 ui::mojom::WindowTreePtr tree_; | 172 ui::mojom::WindowTreePtr tree_; |
| 173 cc::LocalSurfaceId current_local_surface_id_; |
| 164 mojo::Binding<ui::mojom::WindowTreeClient> binding_; | 174 mojo::Binding<ui::mojom::WindowTreeClient> binding_; |
| 165 | 175 |
| 166 DISALLOW_COPY_AND_ASSIGN(RendererWindowTreeClient); | 176 DISALLOW_COPY_AND_ASSIGN(RendererWindowTreeClient); |
| 167 }; | 177 }; |
| 168 | 178 |
| 169 } // namespace content | 179 } // namespace content |
| 170 | 180 |
| 171 #endif // CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ | 181 #endif // CONTENT_RENDERER_MUS_RENDERER_WINDOW_TREE_CLIENT_H_ |
| OLD | NEW |