• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_
6 #define MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_
7 
8 #include <map>
9 
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "mojo/public/cpp/gles2/gles2.h"
13 #include "mojo/services/view_manager/view_manager_export.h"
14 
15 namespace aura {
16 namespace client {
17 class FocusClient;
18 class WindowTreeClient;
19 }
20 class WindowTreeHost;
21 }
22 
23 namespace gfx {
24 class Screen;
25 }
26 
27 namespace mojo {
28 
29 class ServiceProvider;
30 
31 namespace view_manager {
32 namespace service {
33 
34 class RootNodeManager;
35 class RootViewManagerDelegate;
36 
37 // RootViewManager binds the root node to an actual display.
38 class MOJO_VIEW_MANAGER_EXPORT RootViewManager {
39  public:
40   RootViewManager(ServiceProvider* service_provider,
41                   RootNodeManager* root_node,
42                   RootViewManagerDelegate* delegate);
43   virtual ~RootViewManager();
44 
45   // See description above field for details.
in_setup()46   bool in_setup() const { return in_setup_; }
47 
48  private:
49   void OnCompositorCreated();
50 
51   RootViewManagerDelegate* delegate_;
52 
53   RootNodeManager* root_node_manager_;
54 
55   GLES2Initializer gles_initializer_;
56 
57   // Returns true if adding the root node's window to |window_tree_host_|.
58   bool in_setup_;
59 
60   scoped_ptr<gfx::Screen> screen_;
61   scoped_ptr<aura::WindowTreeHost> window_tree_host_;
62   scoped_ptr<aura::client::WindowTreeClient> window_tree_client_;
63   scoped_ptr<aura::client::FocusClient> focus_client_;
64 
65   DISALLOW_COPY_AND_ASSIGN(RootViewManager);
66 };
67 
68 }  // namespace service
69 }  // namespace view_manager
70 }  // namespace mojo
71 
72 #endif  // MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_
73