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_
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"
22 class WindowTreeClient
;
34 class ApplicationConnection
;
38 class ConnectionManager
;
39 class DisplayManagerDelegate
;
42 // DisplayManager binds the root view to an actual display.
43 class MOJO_VIEW_MANAGER_EXPORT DisplayManager
{
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_
; }
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_|.
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
85 #endif // MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_