Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / mojo / services / view_manager / display_manager.h
blob1aa401dd8e01ea5b107c3817146036d572e26b03
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_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_
6 #define MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_
8 #include <map>
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "mojo/public/cpp/bindings/callback.h"
13 #include "mojo/services/view_manager/view_manager_export.h"
15 namespace gfx {
16 class Rect;
19 namespace aura {
20 namespace client {
21 class FocusClient;
22 class WindowTreeClient;
24 class Window;
25 class WindowTreeHost;
28 namespace gfx {
29 class Screen;
32 namespace mojo {
34 class ApplicationConnection;
36 namespace service {
38 class ConnectionManager;
39 class DisplayManagerDelegate;
40 class ServerView;
42 // DisplayManager binds the root view to an actual display.
43 class MOJO_VIEW_MANAGER_EXPORT DisplayManager {
44 public:
45 DisplayManager(ApplicationConnection* app_connection,
46 ConnectionManager* connection_manager,
47 DisplayManagerDelegate* delegate,
48 const Callback<void()>& native_viewport_closed_callback);
49 virtual ~DisplayManager();
51 // Schedules a paint for the specified region of the specified view.
52 void SchedulePaint(const ServerView* view, const gfx::Rect& bounds);
54 // See description above field for details.
55 bool in_setup() const { return in_setup_; }
57 private:
58 class RootWindowDelegateImpl;
60 void OnCompositorCreated();
62 DisplayManagerDelegate* delegate_;
64 ConnectionManager* connection_manager_;
66 // Returns true if adding the root view's window to |window_tree_host_|.
67 bool in_setup_;
69 scoped_ptr<RootWindowDelegateImpl> window_delegate_;
71 // Owned by its parent aura::Window.
72 aura::Window* root_window_;
74 scoped_ptr<gfx::Screen> screen_;
75 scoped_ptr<aura::WindowTreeHost> window_tree_host_;
76 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_;
77 scoped_ptr<aura::client::FocusClient> focus_client_;
79 DISALLOW_COPY_AND_ASSIGN(DisplayManager);
82 } // namespace service
83 } // namespace mojo
85 #endif // MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_