summaryrefslogtreecommitdiffstats
path: root/mojo/services/view_manager/root_view_manager.h
blob: 366e86bd39f1617b30602fe31cd0e73ff2f68c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_
#define MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_

#include <map>

#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/public/cpp/bindings/callback.h"
#include "mojo/services/view_manager/view_manager_export.h"

namespace aura {
namespace client {
class FocusClient;
class WindowTreeClient;
}
class WindowTreeHost;
}

namespace gfx {
class Screen;
}

namespace mojo {

class ApplicationConnection;

namespace service {

class RootNodeManager;
class RootViewManagerDelegate;

// RootViewManager binds the root node to an actual display.
class MOJO_VIEW_MANAGER_EXPORT RootViewManager {
 public:
  RootViewManager(ApplicationConnection* app_connection,
                  RootNodeManager* root_node,
                  RootViewManagerDelegate* delegate,
                  const Callback<void()>& native_viewport_closed_callback);
  virtual ~RootViewManager();

  // See description above field for details.
  bool in_setup() const { return in_setup_; }

 private:
  void OnCompositorCreated();

  RootViewManagerDelegate* delegate_;

  RootNodeManager* root_node_manager_;

  // Returns true if adding the root node's window to |window_tree_host_|.
  bool in_setup_;

  scoped_ptr<gfx::Screen> screen_;
  scoped_ptr<aura::WindowTreeHost> window_tree_host_;
  scoped_ptr<aura::client::WindowTreeClient> window_tree_client_;
  scoped_ptr<aura::client::FocusClient> focus_client_;

  DISALLOW_COPY_AND_ASSIGN(RootViewManager);
};

}  // namespace service
}  // namespace mojo

#endif  // MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_