1 // 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.
5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_H_
6 #define ASH_WM_WORKSPACE_WORKSPACE_H_
10 #include "ash/ash_export.h"
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
25 class WorkspaceEventHandler
;
26 class WorkspaceLayoutManager
;
27 class WorkspaceManager
;
29 // Workspace is used to maintain either a single maximized windows (including
30 // transients and other windows) or any number of windows (for the
31 // desktop). Workspace is used by WorkspaceManager to manage a set of windows.
32 class ASH_EXPORT Workspace
{
34 Workspace(WorkspaceManager
* manager
,
39 // Returns the topmost activatable window. This corresponds to the most
40 // recently activated window in the workspace.
41 aura::Window
* GetTopmostActivatableWindow();
43 // Resets state. This should be used before destroying the Workspace.
44 aura::Window
* ReleaseWindow();
46 bool is_maximized() const { return is_maximized_
; }
48 aura::Window
* window() { return window_
; }
50 const WorkspaceLayoutManager
* workspace_layout_manager() const {
51 return workspace_layout_manager_
;
53 WorkspaceLayoutManager
* workspace_layout_manager() {
54 return workspace_layout_manager_
;
57 const WorkspaceManager
* workspace_manager() const {
58 return workspace_manager_
;
60 WorkspaceManager
* workspace_manager() { return workspace_manager_
; }
62 // Returns true if the Workspace should be moved to pending. This is true
63 // if there are no visible maximized windows.
64 bool ShouldMoveToPending() const;
66 // Returns the number of maximized windows (including minimized windows that
67 // would be maximized on restore). This does not consider visibility.
68 int GetNumMaximizedWindows() const;
71 // Is this a workspace for maximized windows?
72 const bool is_maximized_
;
74 WorkspaceManager
* workspace_manager_
;
76 // Our Window, owned by |parent| passed to the constructor.
77 aura::Window
* window_
;
79 scoped_ptr
<WorkspaceEventHandler
> event_handler_
;
81 WorkspaceLayoutManager
* workspace_layout_manager_
;
83 DISALLOW_COPY_AND_ASSIGN(Workspace
);
86 } // namespace internal
89 #endif // ASH_WM_WORKSPACE_WORKSPACE_H_