| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_H_ | 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_H_ | 6 #define ASH_WM_WORKSPACE_WORKSPACE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 | 13 |
| 14 namespace aura { | 14 namespace aura { |
| 15 class Window; | 15 class Window; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Rect; | 19 class Rect; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace ash { | 22 namespace ash { |
| 23 namespace internal { | 23 namespace internal { |
| 24 | 24 |
| 25 class WorkspaceEventHandler; | 25 class WorkspaceEventHandler; |
| 26 class WorkspaceLayoutManager; | 26 class WorkspaceLayoutManager; |
| 27 class WorkspaceManager; | 27 class WorkspaceManager; |
| 28 | 28 |
| 29 // Workspace is used to maintain either a single maximized windows (including | 29 // Workspace is used to maintain either a single fullscreen windows (including |
| 30 // transients and other windows) or any number of windows (for the | 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. | 31 // desktop). Workspace is used by WorkspaceManager to manage a set of windows. |
| 32 class ASH_EXPORT Workspace { | 32 class ASH_EXPORT Workspace { |
| 33 public: | 33 public: |
| 34 Workspace(WorkspaceManager* manager, | 34 Workspace(WorkspaceManager* manager, |
| 35 aura::Window* parent, | 35 aura::Window* parent, |
| 36 bool is_maximized); | 36 bool is_fullscreen); |
| 37 ~Workspace(); | 37 ~Workspace(); |
| 38 | 38 |
| 39 // Returns the topmost activatable window. This corresponds to the most | 39 // Returns the topmost activatable window. This corresponds to the most |
| 40 // recently activated window in the workspace. | 40 // recently activated window in the workspace. |
| 41 aura::Window* GetTopmostActivatableWindow(); | 41 aura::Window* GetTopmostActivatableWindow(); |
| 42 | 42 |
| 43 // Resets state. This should be used before destroying the Workspace. | 43 // Resets state. This should be used before destroying the Workspace. |
| 44 aura::Window* ReleaseWindow(); | 44 aura::Window* ReleaseWindow(); |
| 45 | 45 |
| 46 bool is_maximized() const { return is_maximized_; } | 46 bool is_fullscreen() const { return is_fullscreen_; } |
| 47 | 47 |
| 48 aura::Window* window() { return window_; } | 48 aura::Window* window() { return window_; } |
| 49 | 49 |
| 50 const WorkspaceLayoutManager* workspace_layout_manager() const { | 50 const WorkspaceLayoutManager* workspace_layout_manager() const { |
| 51 return workspace_layout_manager_; | 51 return workspace_layout_manager_; |
| 52 } | 52 } |
| 53 WorkspaceLayoutManager* workspace_layout_manager() { | 53 WorkspaceLayoutManager* workspace_layout_manager() { |
| 54 return workspace_layout_manager_; | 54 return workspace_layout_manager_; |
| 55 } | 55 } |
| 56 | 56 |
| 57 const WorkspaceManager* workspace_manager() const { | 57 const WorkspaceManager* workspace_manager() const { |
| 58 return workspace_manager_; | 58 return workspace_manager_; |
| 59 } | 59 } |
| 60 WorkspaceManager* workspace_manager() { return workspace_manager_; } | 60 WorkspaceManager* workspace_manager() { return workspace_manager_; } |
| 61 | 61 |
| 62 // Returns true if the Workspace should be moved to pending. This is true | 62 // Returns true if the Workspace should be moved to pending. This is true |
| 63 // if there are no visible maximized windows. | 63 // if there are no visible fullscreen windows. |
| 64 bool ShouldMoveToPending() const; | 64 bool ShouldMoveToPending() const; |
| 65 | 65 |
| 66 // Returns the number of maximized windows (including minimized windows that | 66 // Returns the number of fullscreen windows (including minimized windows that |
| 67 // would be maximized on restore). This does not consider visibility. | 67 // would be fullscreen on restore). This does not consider visibility. |
| 68 int GetNumMaximizedWindows() const; | 68 int GetNumFullscreenWindows() const; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 // Is this a workspace for maximized windows? | 71 // Is this a workspace for fullscreen windows? |
| 72 const bool is_maximized_; | 72 const bool is_fullscreen_; |
| 73 | 73 |
| 74 WorkspaceManager* workspace_manager_; | 74 WorkspaceManager* workspace_manager_; |
| 75 | 75 |
| 76 // Our Window, owned by |parent| passed to the constructor. | 76 // Our Window, owned by |parent| passed to the constructor. |
| 77 aura::Window* window_; | 77 aura::Window* window_; |
| 78 | 78 |
| 79 scoped_ptr<WorkspaceEventHandler> event_handler_; | 79 scoped_ptr<WorkspaceEventHandler> event_handler_; |
| 80 | 80 |
| 81 WorkspaceLayoutManager* workspace_layout_manager_; | 81 WorkspaceLayoutManager* workspace_layout_manager_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(Workspace); | 83 DISALLOW_COPY_AND_ASSIGN(Workspace); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace internal | 86 } // namespace internal |
| 87 } // namespace ash | 87 } // namespace ash |
| 88 | 88 |
| 89 #endif // ASH_WM_WORKSPACE_WORKSPACE_H_ | 89 #endif // ASH_WM_WORKSPACE_WORKSPACE_H_ |
| OLD | NEW |