| 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_MANAGER_H_ | 5 #ifndef ASH_WM_WORKSPACE_MANAGER_H_ |
| 6 #define ASH_WM_WORKSPACE_MANAGER_H_ | 6 #define ASH_WM_WORKSPACE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Returns the Window this WorkspaceManager controls. | 69 // Returns the Window this WorkspaceManager controls. |
| 70 aura::Window* contents_view() { return contents_view_; } | 70 aura::Window* contents_view() { return contents_view_; } |
| 71 | 71 |
| 72 // Returns the window for rotate operation based on the |location|. | 72 // Returns the window for rotate operation based on the |location|. |
| 73 // TODO: this isn't currently used; remove if we do away with overview. | 73 // TODO: this isn't currently used; remove if we do away with overview. |
| 74 aura::Window* FindRotateWindowForLocation(const gfx::Point& location); | 74 aura::Window* FindRotateWindowForLocation(const gfx::Point& location); |
| 75 | 75 |
| 76 // Returns the bounds in which a window can be moved/resized. | 76 // Returns the bounds in which a window can be moved/resized. |
| 77 gfx::Rect GetDragAreaBounds(); | 77 gfx::Rect GetDragAreaBounds(); |
| 78 | 78 |
| 79 // Returns the window the layout manager should allow the size to be set for. |
| 80 // TODO: maybe this should be set on WorkspaceLayoutManager. |
| 81 aura::Window* ignored_window() { return ignored_window_; } |
| 82 |
| 79 // Sets the size of the grid. Newly added windows are forced to align to the | 83 // Sets the size of the grid. Newly added windows are forced to align to the |
| 80 // size of the grid. | 84 // size of the grid. |
| 81 void set_grid_size(int size) { grid_size_ = size; } | 85 void set_grid_size(int size) { grid_size_ = size; } |
| 82 int grid_size() const { return grid_size_; } | 86 int grid_size() const { return grid_size_; } |
| 83 | 87 |
| 84 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } | 88 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } |
| 85 | 89 |
| 86 // Updates the visibility and whether any windows overlap the shelf. | 90 // Updates the visibility and whether any windows overlap the shelf. |
| 87 void UpdateShelfVisibility(); | 91 void UpdateShelfVisibility(); |
| 88 | 92 |
| 89 // Returns the current window state. | 93 // Returns the current window state. |
| 90 WindowState GetWindowState(); | 94 WindowState GetWindowState(); |
| 91 | 95 |
| 92 // Invoked when the show state of the specified window changes. | 96 // Invoked when the show state of the specified window changes. |
| 93 void ShowStateChanged(aura::Window* window); | 97 void ShowStateChanged(aura::Window* window); |
| 94 | 98 |
| 95 private: | 99 private: |
| 96 // Enumeration of whether windows should animate or not. | 100 // Enumeration of whether windows should animate or not. |
| 97 enum AnimateChangeType { | 101 enum AnimateChangeType { |
| 98 ANIMATE, | 102 ANIMATE, |
| 99 DONT_ANIMATE | 103 DONT_ANIMATE |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 friend class Workspace; | 106 friend class Workspace; |
| 103 friend class WorkspaceManagerTest; | 107 friend class WorkspaceManagerTest; |
| 104 | 108 |
| 109 // See description above getter. |
| 110 void set_ignored_window(aura::Window* ignored_window) { |
| 111 ignored_window_ = ignored_window; |
| 112 } |
| 113 |
| 105 void AddWorkspace(Workspace* workspace); | 114 void AddWorkspace(Workspace* workspace); |
| 106 void RemoveWorkspace(Workspace* workspace); | 115 void RemoveWorkspace(Workspace* workspace); |
| 107 | 116 |
| 108 // Sets the visibility of the windows in |workspace|. | 117 // Sets the visibility of the windows in |workspace|. |
| 109 void SetVisibilityOfWorkspaceWindows(Workspace* workspace, | 118 void SetVisibilityOfWorkspaceWindows(Workspace* workspace, |
| 110 AnimateChangeType change_type, | 119 AnimateChangeType change_type, |
| 111 bool value); | 120 bool value); |
| 112 | 121 |
| 113 // Implementation of SetVisibilityOfWorkspaceWindows(). | 122 // Implementation of SetVisibilityOfWorkspaceWindows(). |
| 114 void SetWindowLayerVisibility(const std::vector<aura::Window*>& windows, | 123 void SetWindowLayerVisibility(const std::vector<aura::Window*>& windows, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 155 |
| 147 // Deletes workspaces of TYPE_MAXIMIZED when they become empty. | 156 // Deletes workspaces of TYPE_MAXIMIZED when they become empty. |
| 148 void CleanupWorkspace(Workspace* workspace); | 157 void CleanupWorkspace(Workspace* workspace); |
| 149 | 158 |
| 150 aura::Window* contents_view_; | 159 aura::Window* contents_view_; |
| 151 | 160 |
| 152 Workspace* active_workspace_; | 161 Workspace* active_workspace_; |
| 153 | 162 |
| 154 std::vector<Workspace*> workspaces_; | 163 std::vector<Workspace*> workspaces_; |
| 155 | 164 |
| 156 // Window being maximized or restored during a workspace type change. | 165 // The window that WorkspaceManager does not set the bounds on. |
| 157 // It has its own animation and is ignored by workspace show/hide animations. | 166 aura::Window* ignored_window_; |
| 158 aura::Window* maximize_restore_window_; | |
| 159 | 167 |
| 160 // See description above setter. | 168 // See description above setter. |
| 161 int grid_size_; | 169 int grid_size_; |
| 162 | 170 |
| 163 // Owned by the Shell container window LauncherContainer. May be NULL. | 171 // Owned by the Shell container window LauncherContainer. May be NULL. |
| 164 ShelfLayoutManager* shelf_; | 172 ShelfLayoutManager* shelf_; |
| 165 | 173 |
| 166 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); | 174 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); |
| 167 }; | 175 }; |
| 168 | 176 |
| 169 } // namespace internal | 177 } // namespace internal |
| 170 } // namespace ash | 178 } // namespace ash |
| 171 | 179 |
| 172 #endif // ASH_WM_WORKSPACE_MANAGER_H_ | 180 #endif // ASH_WM_WORKSPACE_MANAGER_H_ |
| OLD | NEW |