| 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 MANDOLINE_UI_AURA_SURFACE_BINDING_H_ | 5 #ifndef MANDOLINE_UI_AURA_SURFACE_BINDING_H_ |
| 6 #define MANDOLINE_UI_AURA_SURFACE_BINDING_H_ | 6 #define MANDOLINE_UI_AURA_SURFACE_BINDING_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 class OutputSurface; | 12 class OutputSurface; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace mojo { | 15 namespace mojo { |
| 16 class Shell; | 16 class Shell; |
| 17 } |
| 18 |
| 19 namespace mus { |
| 17 class View; | 20 class View; |
| 18 } | 21 } |
| 19 | 22 |
| 20 namespace mandoline { | 23 namespace mandoline { |
| 21 | 24 |
| 22 // SurfaceBinding is responsible for managing the connections necessary to | 25 // SurfaceBinding is responsible for managing the connections necessary to |
| 23 // bind a View to the surfaces service. | 26 // bind a View to the surfaces service. |
| 24 // Internally SurfaceBinding manages one connection (and related structures) per | 27 // Internally SurfaceBinding manages one connection (and related structures) per |
| 25 // ViewTreeConnection. That is, all Views from a particular ViewTreeConnection | 28 // ViewTreeConnection. That is, all Views from a particular ViewTreeConnection |
| 26 // share the same connection. | 29 // share the same connection. |
| 27 class SurfaceBinding { | 30 class SurfaceBinding { |
| 28 public: | 31 public: |
| 29 SurfaceBinding(mojo::Shell* shell, mojo::View* view); | 32 SurfaceBinding(mojo::Shell* shell, mus::View* view); |
| 30 ~SurfaceBinding(); | 33 ~SurfaceBinding(); |
| 31 | 34 |
| 32 // Creates an OutputSurface that renders to the View supplied to the | 35 // Creates an OutputSurface that renders to the View supplied to the |
| 33 // constructor. | 36 // constructor. |
| 34 scoped_ptr<cc::OutputSurface> CreateOutputSurface(); | 37 scoped_ptr<cc::OutputSurface> CreateOutputSurface(); |
| 35 | 38 |
| 36 private: | 39 private: |
| 37 class PerConnectionState; | 40 class PerConnectionState; |
| 38 | 41 |
| 39 mojo::Shell* shell_; | 42 mojo::Shell* shell_; |
| 40 mojo::View* view_; | 43 mus::View* view_; |
| 41 scoped_refptr<PerConnectionState> state_; | 44 scoped_refptr<PerConnectionState> state_; |
| 42 | 45 |
| 43 DISALLOW_COPY_AND_ASSIGN(SurfaceBinding); | 46 DISALLOW_COPY_AND_ASSIGN(SurfaceBinding); |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 } // namespace mandoline | 49 } // namespace mandoline |
| 47 | 50 |
| 48 #endif // MANDOLINE_UI_AURA_SURFACE_BINDING_H_ | 51 #endif // MANDOLINE_UI_AURA_SURFACE_BINDING_H_ |
| OLD | NEW |