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 #ifndef UI_VIEWS_MUS_SURFACE_BINDING_H_ | 5 #ifndef UI_VIEWS_MUS_SURFACE_BINDING_H_ |
6 #define UI_VIEWS_MUS_SURFACE_BINDING_H_ | 6 #define UI_VIEWS_MUS_SURFACE_BINDING_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "services/ui/public/interfaces/window_tree.mojom.h" | 12 #include "services/ui/public/interfaces/window_tree.mojom.h" |
13 #include "ui/views/mus/mus_export.h" | 13 #include "ui/views/mus/mus_export.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 class OutputSurface; | 16 class OutputSurface; |
17 } | 17 } |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 class Window; | 20 class Window; |
21 } | 21 } |
22 | 22 |
| 23 namespace shell { |
| 24 class Connector; |
| 25 } |
| 26 |
23 namespace views { | 27 namespace views { |
24 | 28 |
25 // SurfaceBinding is responsible for managing the connections necessary to | 29 // SurfaceBinding is responsible for managing the connections necessary to |
26 // bind a Window to the surfaces service. | 30 // bind a Window to the surfaces service. |
27 // Internally SurfaceBinding manages one connection (and related structures) per | 31 // Internally SurfaceBinding manages one connection (and related structures) per |
28 // WindowTree. That is, all Windows from a particular WindowTree share the same | 32 // WindowTree. That is, all Windows from a particular WindowTree share the same |
29 // connection. | 33 // connection. |
30 class VIEWS_MUS_EXPORT SurfaceBinding { | 34 class VIEWS_MUS_EXPORT SurfaceBinding { |
31 public: | 35 public: |
32 SurfaceBinding(ui::Window* window, ui::mojom::SurfaceType surface_type); | 36 SurfaceBinding(shell::Connector* connector, |
| 37 ui::Window* window, |
| 38 ui::mojom::SurfaceType surface_type); |
33 ~SurfaceBinding(); | 39 ~SurfaceBinding(); |
34 | 40 |
35 // Creates an OutputSurface that renders to the Window supplied to the | 41 // Creates an OutputSurface that renders to the Window supplied to the |
36 // constructor. | 42 // constructor. |
37 std::unique_ptr<cc::OutputSurface> CreateOutputSurface(); | 43 std::unique_ptr<cc::OutputSurface> CreateOutputSurface(); |
38 | 44 |
39 private: | 45 private: |
40 class PerClientState; | 46 class PerClientState; |
41 | 47 |
42 ui::Window* window_; | 48 ui::Window* window_; |
43 const ui::mojom::SurfaceType surface_type_; | 49 const ui::mojom::SurfaceType surface_type_; |
44 scoped_refptr<PerClientState> state_; | 50 scoped_refptr<PerClientState> state_; |
45 | 51 |
46 DISALLOW_COPY_AND_ASSIGN(SurfaceBinding); | 52 DISALLOW_COPY_AND_ASSIGN(SurfaceBinding); |
47 }; | 53 }; |
48 | 54 |
49 } // namespace views | 55 } // namespace views |
50 | 56 |
51 #endif // UI_VIEWS_MUS_SURFACE_BINDING_H_ | 57 #endif // UI_VIEWS_MUS_SURFACE_BINDING_H_ |
OLD | NEW |