Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: ash/wm/workspace/workspace_manager.cc

Issue 14663010: Save and restore State for ShellWindows, including panels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_manager.h" 5 #include "ash/wm/workspace/workspace_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 // static 154 // static
155 bool WorkspaceManager::IsMaximizedState(ui::WindowShowState state) { 155 bool WorkspaceManager::IsMaximizedState(ui::WindowShowState state) {
156 return state == ui::SHOW_STATE_MAXIMIZED || 156 return state == ui::SHOW_STATE_MAXIMIZED ||
157 state == ui::SHOW_STATE_FULLSCREEN; 157 state == ui::SHOW_STATE_FULLSCREEN;
158 } 158 }
159 159
160 // static 160 // static
161 bool WorkspaceManager::WillRestoreMaximized(Window* window) { 161 bool WorkspaceManager::WillRestoreMaximized(Window* window) {
162 return wm::IsWindowMinimized(window) && 162 return wm::IsWindowMinimized(window) &&
163 IsMaximizedState(window->GetProperty(internal::kRestoreShowStateKey)); 163 IsMaximizedState(window->GetProperty(aura::client::kRestoreShowStateKey));
164 } 164 }
165 165
166 WorkspaceWindowState WorkspaceManager::GetWindowState() const { 166 WorkspaceWindowState WorkspaceManager::GetWindowState() const {
167 if (!shelf_) 167 if (!shelf_)
168 return WORKSPACE_WINDOW_STATE_DEFAULT; 168 return WORKSPACE_WINDOW_STATE_DEFAULT;
169 169
170 const bool is_active_maximized = active_workspace_->is_maximized(); 170 const bool is_active_maximized = active_workspace_->is_maximized();
171 const gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); 171 const gfx::Rect shelf_bounds(shelf_->GetIdealBounds());
172 const Window::Windows& windows(active_workspace_->window()->children()); 172 const Window::Windows& windows(active_workspace_->window()->children());
173 bool window_overlaps_launcher = false; 173 bool window_overlaps_launcher = false;
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 new_workspace->window()->Show(); 823 new_workspace->window()->Show();
824 ReparentWindow(window, new_workspace->window(), NULL); 824 ReparentWindow(window, new_workspace->window(), NULL);
825 if (is_active) { 825 if (is_active) {
826 SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED, 826 SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED,
827 base::TimeDelta()); 827 base::TimeDelta());
828 } 828 }
829 } 829 }
830 830
831 } // namespace internal 831 } // namespace internal
832 } // namespace ash 832 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager.cc ('k') | chrome/browser/extensions/api/app_window/app_window_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698