blob: 66cf1050cf420acfe9762028867f7bf81a933ef3 [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_
7#pragma once
8
9#include "base/basictypes.h"
10#include "base/memory/scoped_ptr.h"
11
12class SkBitmap;
13
14namespace aura {
15class EventFilter;
16class RootWindow;
17class Window;
18namespace shared {
19class InputMethodEventFilter;
20class RootWindowEventFilter;
21} // namespace shared
22} // namespace aura
23
24namespace ash {
25namespace internal {
26
27class EventClientImpl;
28class RootWindowLayoutManager;
29class ScreenDimmer;
30class WorkspaceController;
31
32// This class maintains the per root window state for ash. This class
33// owns the root window and other dependent objects that should be
34// deleted upon the deletion of the root window. The RootWindowController
35// for particular root window is stored as a property and can be obtained
36// using |GetRootWindowController(aura::RootWindow*)| function.
37class RootWindowController {
38 public:
39 explicit RootWindowController(aura::RootWindow* root_window);
40 ~RootWindowController();
41
42 aura::RootWindow* root_window() {
43 return root_window_.get();
44 }
45
46 internal::RootWindowLayoutManager* root_window_layout() {
47 return root_window_layout_;
48 }
49
50 internal::WorkspaceController* workspace_controller() {
51 return workspace_controller_.get();
52 }
53
54 internal::ScreenDimmer* screen_dimmer() {
55 return screen_dimmer_.get();
56 }
57
58 aura::Window* GetContainer(int container_id);
59
60 void CreateContainers();
61 void InitLayoutManagers();
62
63 // Deletes all child windows and performs necessary cleanup.
64 void CloseChildWindows();
65
66 // Returns true if the workspace has a maximized or fullscreen window.
67 bool IsInMaximizedMode() const;
68
69 private:
70 scoped_ptr<aura::RootWindow> root_window_;
71 internal::RootWindowLayoutManager* root_window_layout_;
72
73 // An event filter that pre-handles all key events to send them to an IME.
74 scoped_ptr<internal::EventClientImpl> event_client_;
75 scoped_ptr<internal::ScreenDimmer> screen_dimmer_;
76 scoped_ptr<internal::WorkspaceController> workspace_controller_;
77
78 DISALLOW_COPY_AND_ASSIGN(RootWindowController);
79};
80
81} // namespace internal
82} // ash
83
84#endif // ASH_ROOT_WINDOW_CONTROLLER_H_