| 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 #include "ash/wm/workspace/workspace_manager2.h" | 5 #include "ash/wm/workspace/workspace_manager2.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return state == ui::SHOW_STATE_MAXIMIZED || | 147 return state == ui::SHOW_STATE_MAXIMIZED || |
| 148 state == ui::SHOW_STATE_FULLSCREEN; | 148 state == ui::SHOW_STATE_FULLSCREEN; |
| 149 } | 149 } |
| 150 | 150 |
| 151 // static | 151 // static |
| 152 bool WorkspaceManager2::WillRestoreMaximized(Window* window) { | 152 bool WorkspaceManager2::WillRestoreMaximized(Window* window) { |
| 153 return wm::IsWindowMinimized(window) && | 153 return wm::IsWindowMinimized(window) && |
| 154 IsMaximizedState(window->GetProperty(internal::kRestoreShowStateKey)); | 154 IsMaximizedState(window->GetProperty(internal::kRestoreShowStateKey)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool WorkspaceManager2::IsInMaximizedMode() const { | |
| 158 return active_workspace_ && active_workspace_->is_maximized(); | |
| 159 } | |
| 160 | |
| 161 WorkspaceWindowState WorkspaceManager2::GetWindowState() const { | 157 WorkspaceWindowState WorkspaceManager2::GetWindowState() const { |
| 162 if (!shelf_) | 158 if (!shelf_) |
| 163 return WORKSPACE_WINDOW_STATE_DEFAULT; | 159 return WORKSPACE_WINDOW_STATE_DEFAULT; |
| 164 | 160 |
| 165 const bool is_active_maximized = active_workspace_->is_maximized(); | 161 const bool is_active_maximized = active_workspace_->is_maximized(); |
| 166 const gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); | 162 const gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); |
| 167 const Window::Windows& windows(active_workspace_->window()->children()); | 163 const Window::Windows& windows(active_workspace_->window()->children()); |
| 168 bool window_overlaps_launcher = false; | 164 bool window_overlaps_launcher = false; |
| 169 bool has_maximized_window = false; | 165 bool has_maximized_window = false; |
| 170 for (Window::Windows::const_iterator i = windows.begin(); | 166 for (Window::Windows::const_iterator i = windows.begin(); |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 new_workspace->window()->Show(); | 712 new_workspace->window()->Show(); |
| 717 ReparentWindow(window, new_workspace->window(), NULL); | 713 ReparentWindow(window, new_workspace->window(), NULL); |
| 718 if (is_active) { | 714 if (is_active) { |
| 719 SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED, | 715 SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED, |
| 720 base::TimeDelta()); | 716 base::TimeDelta()); |
| 721 } | 717 } |
| 722 } | 718 } |
| 723 | 719 |
| 724 } // namespace internal | 720 } // namespace internal |
| 725 } // namespace ash | 721 } // namespace ash |
| OLD | NEW |