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

Side by Side Diff: ash/wm/workspace/workspace_layout_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
« no previous file with comments | « ash/wm/window_properties.cc ('k') | ash/wm/workspace/workspace_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_layout_manager.h" 5 #include "ash/wm/workspace/workspace_layout_manager.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/session_state_delegate.h" 9 #include "ash/session_state_delegate.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 void WorkspaceLayoutManager::OnWindowRemovedFromLayout(Window* child) { 120 void WorkspaceLayoutManager::OnWindowRemovedFromLayout(Window* child) {
121 workspace_manager()->OnWindowRemovedFromWorkspace(workspace_, child); 121 workspace_manager()->OnWindowRemovedFromWorkspace(workspace_, child);
122 } 122 }
123 123
124 void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(Window* child, 124 void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(Window* child,
125 bool visible) { 125 bool visible) {
126 if (visible && wm::IsWindowMinimized(child)) { 126 if (visible && wm::IsWindowMinimized(child)) {
127 // Attempting to show a minimized window. Unminimize it. 127 // Attempting to show a minimized window. Unminimize it.
128 child->SetProperty(aura::client::kShowStateKey, 128 child->SetProperty(aura::client::kShowStateKey,
129 child->GetProperty(internal::kRestoreShowStateKey)); 129 child->GetProperty(aura::client::kRestoreShowStateKey));
130 child->ClearProperty(internal::kRestoreShowStateKey); 130 child->ClearProperty(aura::client::kRestoreShowStateKey);
131 } 131 }
132 workspace_manager()->OnWorkspaceChildWindowVisibilityChanged(workspace_, 132 workspace_manager()->OnWorkspaceChildWindowVisibilityChanged(workspace_,
133 child); 133 child);
134 } 134 }
135 135
136 void WorkspaceLayoutManager::SetChildBounds( 136 void WorkspaceLayoutManager::SetChildBounds(
137 Window* child, 137 Window* child,
138 const gfx::Rect& requested_bounds) { 138 const gfx::Rect& requested_bounds) {
139 if (!GetTrackedByWorkspace(child)) { 139 if (!GetTrackedByWorkspace(child)) {
140 SetChildBoundsDirect(child, requested_bounds); 140 SetChildBoundsDirect(child, requested_bounds);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 } 251 }
252 252
253 void WorkspaceLayoutManager::ShowStateChanged( 253 void WorkspaceLayoutManager::ShowStateChanged(
254 Window* window, 254 Window* window,
255 ui::WindowShowState last_show_state, 255 ui::WindowShowState last_show_state,
256 ui::Layer* cloned_layer) { 256 ui::Layer* cloned_layer) {
257 if (wm::IsWindowMinimized(window)) { 257 if (wm::IsWindowMinimized(window)) {
258 DCHECK(!cloned_layer); 258 DCHECK(!cloned_layer);
259 // Save the previous show state so that we can correctly restore it. 259 // Save the previous show state so that we can correctly restore it.
260 window->SetProperty(internal::kRestoreShowStateKey, last_show_state); 260 window->SetProperty(aura::client::kRestoreShowStateKey, last_show_state);
261 views::corewm::SetWindowVisibilityAnimationType( 261 views::corewm::SetWindowVisibilityAnimationType(
262 window, WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); 262 window, WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE);
263 workspace_manager()->OnWorkspaceWindowShowStateChanged( 263 workspace_manager()->OnWorkspaceWindowShowStateChanged(
264 workspace_, window, last_show_state, NULL); 264 workspace_, window, last_show_state, NULL);
265 window->Hide(); 265 window->Hide();
266 if (wm::IsActiveWindow(window)) 266 if (wm::IsActiveWindow(window))
267 wm::DeactivateWindow(window); 267 wm::DeactivateWindow(window);
268 } else { 268 } else {
269 if ((window->TargetVisibility() || 269 if ((window->TargetVisibility() ||
270 last_show_state == ui::SHOW_STATE_MINIMIZED) && 270 last_show_state == ui::SHOW_STATE_MINIMIZED) &&
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 } 386 }
387 return false; 387 return false;
388 } 388 }
389 389
390 WorkspaceManager* WorkspaceLayoutManager::workspace_manager() { 390 WorkspaceManager* WorkspaceLayoutManager::workspace_manager() {
391 return workspace_->workspace_manager(); 391 return workspace_->workspace_manager();
392 } 392 }
393 393
394 } // namespace internal 394 } // namespace internal
395 } // namespace ash 395 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_properties.cc ('k') | ash/wm/workspace/workspace_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698