| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_SHELL_WORKSPACE_WORKSPACE_MANAGER_H_ | 5 #ifndef UI_AURA_SHELL_WORKSPACE_WORKSPACE_MANAGER_H_ |
| 6 #define UI_AURA_SHELL_WORKSPACE_WORKSPACE_MANAGER_H_ | 6 #define UI_AURA_SHELL_WORKSPACE_WORKSPACE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // this WorkspaceManager. Deleting workspace will automatically | 37 // this WorkspaceManager. Deleting workspace will automatically |
| 38 // remove the workspace from the workspace_manager. | 38 // remove the workspace from the workspace_manager. |
| 39 Workspace* CreateWorkspace(); | 39 Workspace* CreateWorkspace(); |
| 40 | 40 |
| 41 // Returns the active workspace. | 41 // Returns the active workspace. |
| 42 Workspace* GetActiveWorkspace() const; | 42 Workspace* GetActiveWorkspace() const; |
| 43 | 43 |
| 44 // Returns the workspace that contanis the |window|. | 44 // Returns the workspace that contanis the |window|. |
| 45 Workspace* FindBy(aura::Window* window) const; | 45 Workspace* FindBy(aura::Window* window) const; |
| 46 | 46 |
| 47 // Returns the window for swap operation based on the |location|. |
| 48 aura::Window* FindSwapWindowForLocation(const gfx::Point& location); |
| 49 |
| 47 // Sets the bounds of all workspaces. | 50 // Sets the bounds of all workspaces. |
| 48 void LayoutWorkspaces(); | 51 void LayoutWorkspaces(); |
| 49 | 52 |
| 50 // Returns the bounds in which a window can be moved/resized. | 53 // Returns the bounds in which a window can be moved/resized. |
| 51 gfx::Rect GetDragAreaBounds(); | 54 gfx::Rect GetDragAreaBounds(); |
| 52 | 55 |
| 53 // Turn on/off overview mode. | 56 // Turn on/off overview mode. |
| 54 void SetOverview(bool overview); | 57 void SetOverview(bool overview); |
| 55 bool is_overview() const { return is_overview_; } | 58 bool is_overview() const { return is_overview_; } |
| 56 | 59 |
| 60 // Swaps the |drag| and |target|. If they're in the same workspace, |
| 61 // this simply swaps the layout location. If they're in the different |
| 62 // workspaces, these windows move between workspaces. |
| 63 void SwapWindow(aura::Window* drag, aura::Window* target); |
| 64 |
| 57 // Overridden from aura::DesktopObserver: | 65 // Overridden from aura::DesktopObserver: |
| 58 virtual void OnDesktopResized(const gfx::Size& new_size) OVERRIDE; | 66 virtual void OnDesktopResized(const gfx::Size& new_size) OVERRIDE; |
| 59 virtual void OnActiveWindowChanged(aura::Window* active) OVERRIDE; | 67 virtual void OnActiveWindowChanged(aura::Window* active) OVERRIDE; |
| 60 | 68 |
| 61 private: | 69 private: |
| 62 friend class Workspace; | 70 friend class Workspace; |
| 63 FRIEND_TEST_ALL_PREFIXES(WorkspaceManagerTest, Overview); | 71 FRIEND_TEST_ALL_PREFIXES(WorkspaceManagerTest, Overview); |
| 64 FRIEND_TEST_ALL_PREFIXES(WorkspaceManagerTest, LayoutWorkspaces); | 72 FRIEND_TEST_ALL_PREFIXES(WorkspaceManagerTest, LayoutWorkspaces); |
| 73 FRIEND_TEST_ALL_PREFIXES(WorkspaceManagerTest, FindSwapWindow); |
| 65 | 74 |
| 66 void AddWorkspace(Workspace* workspace); | 75 void AddWorkspace(Workspace* workspace); |
| 67 void RemoveWorkspace(Workspace* workspace); | 76 void RemoveWorkspace(Workspace* workspace); |
| 68 | 77 |
| 69 // Sets the active workspace. | 78 // Sets the active workspace. |
| 70 void SetActiveWorkspace(Workspace* workspace); | 79 void SetActiveWorkspace(Workspace* workspace); |
| 71 | 80 |
| 72 // Returns the bounds of the work are given |workspace_bounds|. | 81 // Returns the bounds of the work are given |workspace_bounds|. |
| 73 gfx::Rect GetWorkAreaBounds(const gfx::Rect& workspace_bounds); | 82 gfx::Rect GetWorkAreaBounds(const gfx::Rect& workspace_bounds); |
| 74 | 83 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 87 | 96 |
| 88 // True if the workspace manager is in overview mode. | 97 // True if the workspace manager is in overview mode. |
| 89 bool is_overview_; | 98 bool is_overview_; |
| 90 | 99 |
| 91 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); | 100 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); |
| 92 }; | 101 }; |
| 93 | 102 |
| 94 } // namespace aura_shell | 103 } // namespace aura_shell |
| 95 | 104 |
| 96 #endif // UI_AURA_SHELL_WORKSPACE_WORKSPACE_MANAGER_H_ | 105 #endif // UI_AURA_SHELL_WORKSPACE_WORKSPACE_MANAGER_H_ |
| OLD | NEW |