Chromecast: extracts Linux window creation code to a common place.
[chromium-blink-merge.git] / mojo / aura / surface_binding.h
blob33f6eac04ea78c4df1fbfdb21d0d73dc3e544a55
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MOJO_AURA_SURFACE_BINDING_H_
6 #define MOJO_AURA_SURFACE_BINDING_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
11 namespace cc {
12 class OutputSurface;
15 namespace mojo {
16 class Shell;
17 class View;
19 // SurfaceBinding is responsible for managing the connections necessary to
20 // bind a View to the surfaces service.
21 // Internally SurfaceBinding manages one connection (and related structures) per
22 // ViewManager. That is, all Views from a particular ViewManager share the same
23 // connection.
24 class SurfaceBinding {
25 public:
26 SurfaceBinding(Shell* shell, View* view);
27 ~SurfaceBinding();
29 // Creates an OutputSurface that renders to the View supplied to the
30 // constructor.
31 scoped_ptr<cc::OutputSurface> CreateOutputSurface();
33 private:
34 class PerViewManagerState;
36 Shell* shell_;
37 View* view_;
38 scoped_refptr<PerViewManagerState> state_;
40 DISALLOW_COPY_AND_ASSIGN(SurfaceBinding);
43 } // namespace mojo
45 #endif // MOJO_AURA_SURFACE_BINDING_H_