blob: c17d85a445025365e724ae4ad1b89d15eb73968f [file] [log] [blame]
[email protected]d90b8392012-06-13 09:34:561// Copyright (c) 2012 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 ASH_ROOT_WINDOW_CONTROLLER_H_
6#define ASH_ROOT_WINDOW_CONTROLLER_H_
[email protected]d90b8392012-06-13 09:34:567
8#include "base/basictypes.h"
9#include "base/memory/scoped_ptr.h"
10
11class SkBitmap;
12
13namespace aura {
14class EventFilter;
15class RootWindow;
16class Window;
17namespace shared {
18class InputMethodEventFilter;
19class RootWindowEventFilter;
20} // namespace shared
21} // namespace aura
22
23namespace ash {
24namespace internal {
25
26class EventClientImpl;
27class RootWindowLayoutManager;
28class ScreenDimmer;
29class WorkspaceController;
30
31// This class maintains the per root window state for ash. This class
32// owns the root window and other dependent objects that should be
33// deleted upon the deletion of the root window. The RootWindowController
34// for particular root window is stored as a property and can be obtained
35// using |GetRootWindowController(aura::RootWindow*)| function.
36class RootWindowController {
37 public:
38 explicit RootWindowController(aura::RootWindow* root_window);
39 ~RootWindowController();
40
41 aura::RootWindow* root_window() {
42 return root_window_.get();
43 }
44
45 internal::RootWindowLayoutManager* root_window_layout() {
46 return root_window_layout_;
47 }
48
49 internal::WorkspaceController* workspace_controller() {
50 return workspace_controller_.get();
51 }
52
53 internal::ScreenDimmer* screen_dimmer() {
54 return screen_dimmer_.get();
55 }
56
57 aura::Window* GetContainer(int container_id);
58
59 void CreateContainers();
60 void InitLayoutManagers();
61
[email protected]6675e1c2012-09-11 09:15:4562 // Deletes associated objects and clears the state, but doesn't delete
63 // the root window yet. This is used to delete a secondary displays'
64 // root window safely when the display disconnect signal is received,
65 // which may come while we're in the nested message loop.
66 void Shutdown();
67
[email protected]d90b8392012-06-13 09:34:5668 // Deletes all child windows and performs necessary cleanup.
69 void CloseChildWindows();
70
71 // Returns true if the workspace has a maximized or fullscreen window.
72 bool IsInMaximizedMode() const;
73
[email protected]f1853122012-06-27 16:21:2674 // Moves child windows to |dest|.
75 void MoveWindowsTo(aura::RootWindow* dest);
76
[email protected]d90b8392012-06-13 09:34:5677 private:
78 scoped_ptr<aura::RootWindow> root_window_;
79 internal::RootWindowLayoutManager* root_window_layout_;
80
81 // An event filter that pre-handles all key events to send them to an IME.
82 scoped_ptr<internal::EventClientImpl> event_client_;
83 scoped_ptr<internal::ScreenDimmer> screen_dimmer_;
84 scoped_ptr<internal::WorkspaceController> workspace_controller_;
85
86 DISALLOW_COPY_AND_ASSIGN(RootWindowController);
87};
88
89} // namespace internal
90} // ash
91
92#endif // ASH_ROOT_WINDOW_CONTROLLER_H_