| 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_WORKSPACE2_H_ | 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE2_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 WorkspaceLayoutManager2; | 26 class WorkspaceLayoutManager; |
| 27 class WorkspaceManager2; | 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 maximized 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 Workspace2 { | 32 class ASH_EXPORT Workspace { |
| 33 public: | 33 public: |
| 34 Workspace2(WorkspaceManager2* manager, | 34 Workspace(WorkspaceManager* manager, |
| 35 aura::Window* parent, | 35 aura::Window* parent, |
| 36 bool is_maximized); | 36 bool is_maximized); |
| 37 ~Workspace2(); | 37 ~Workspace(); |
| 38 | 38 |
| 39 // Resets state. This should be used before destroying the Workspace. | 39 // Resets state. This should be used before destroying the Workspace. |
| 40 aura::Window* ReleaseWindow(); | 40 aura::Window* ReleaseWindow(); |
| 41 | 41 |
| 42 bool is_maximized() const { return is_maximized_; } | 42 bool is_maximized() const { return is_maximized_; } |
| 43 | 43 |
| 44 aura::Window* window() { return window_; } | 44 aura::Window* window() { return window_; } |
| 45 | 45 |
| 46 const WorkspaceLayoutManager2* workspace_layout_manager() const { | 46 const WorkspaceLayoutManager* workspace_layout_manager() const { |
| 47 return workspace_layout_manager_; | 47 return workspace_layout_manager_; |
| 48 } | 48 } |
| 49 WorkspaceLayoutManager2* workspace_layout_manager() { | 49 WorkspaceLayoutManager* workspace_layout_manager() { |
| 50 return workspace_layout_manager_; | 50 return workspace_layout_manager_; |
| 51 } | 51 } |
| 52 | 52 |
| 53 const WorkspaceManager2* workspace_manager() const { | 53 const WorkspaceManager* workspace_manager() const { |
| 54 return workspace_manager_; | 54 return workspace_manager_; |
| 55 } | 55 } |
| 56 WorkspaceManager2* workspace_manager() { return workspace_manager_; } | 56 WorkspaceManager* workspace_manager() { return workspace_manager_; } |
| 57 | 57 |
| 58 // Returns true if the Workspace should be moved to pending. This is true | 58 // Returns true if the Workspace should be moved to pending. This is true |
| 59 // if there are no visible maximized windows. | 59 // if there are no visible maximized windows. |
| 60 bool ShouldMoveToPending() const; | 60 bool ShouldMoveToPending() const; |
| 61 | 61 |
| 62 // Returns the number of maximized windows (including minimized windows that | 62 // Returns the number of maximized windows (including minimized windows that |
| 63 // would be maximized on restore). This does not consider visibility. | 63 // would be maximized on restore). This does not consider visibility. |
| 64 int GetNumMaximizedWindows() const; | 64 int GetNumMaximizedWindows() const; |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 // Is this a workspace for maximized windows? | 67 // Is this a workspace for maximized windows? |
| 68 const bool is_maximized_; | 68 const bool is_maximized_; |
| 69 | 69 |
| 70 WorkspaceManager2* workspace_manager_; | 70 WorkspaceManager* workspace_manager_; |
| 71 | 71 |
| 72 // Our Window, owned by |parent| passed to the constructor. | 72 // Our Window, owned by |parent| passed to the constructor. |
| 73 aura::Window* window_; | 73 aura::Window* window_; |
| 74 | 74 |
| 75 scoped_ptr<WorkspaceEventHandler> event_handler_; | 75 scoped_ptr<WorkspaceEventHandler> event_handler_; |
| 76 | 76 |
| 77 WorkspaceLayoutManager2* workspace_layout_manager_; | 77 WorkspaceLayoutManager* workspace_layout_manager_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(Workspace2); | 79 DISALLOW_COPY_AND_ASSIGN(Workspace); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace internal | 82 } // namespace internal |
| 83 } // namespace ash | 83 } // namespace ash |
| 84 | 84 |
| 85 #endif // ASH_WM_WORKSPACE_WORKSPACE2_H_ | 85 #endif // ASH_WM_WORKSPACE_WORKSPACE_H_ |
| OLD | NEW |