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

Side by Side Diff: ash/wm/base_layout_manager.cc

Issue 56483003: Unminimize the minimized state, instead of showing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | 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/base_layout_manager.h" 5 #include "ash/wm/base_layout_manager.h"
6 6
7 #include "ash/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/session_state_delegate.h" 8 #include "ash/session_state_delegate.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 ////////////////////////////////////////////////////////////////////////////// 126 //////////////////////////////////////////////////////////////////////////////
127 // BaseLayoutManager, aura::client::ActivationChangeObserver implementation: 127 // BaseLayoutManager, aura::client::ActivationChangeObserver implementation:
128 128
129 void BaseLayoutManager::OnWindowActivated(aura::Window* gained_active, 129 void BaseLayoutManager::OnWindowActivated(aura::Window* gained_active,
130 aura::Window* lost_active) { 130 aura::Window* lost_active) {
131 wm::WindowState* window_state = wm::GetWindowState(gained_active); 131 wm::WindowState* window_state = wm::GetWindowState(gained_active);
132 if (window_state && window_state->IsMinimized() && 132 if (window_state && window_state->IsMinimized() &&
133 !gained_active->IsVisible()) { 133 !gained_active->IsVisible()) {
134 gained_active->Show(); 134 window_state->Unminimize();
135 DCHECK(!window_state->IsMinimized()); 135 DCHECK(!window_state->IsMinimized());
136 } 136 }
137 } 137 }
138 138
139 ///////////////////////////////////////////////////////////////////////////// 139 /////////////////////////////////////////////////////////////////////////////
140 // BaseLayoutManager, ash::ShellObserver overrides: 140 // BaseLayoutManager, ash::ShellObserver overrides:
141 141
142 void BaseLayoutManager::OnDisplayWorkAreaInsetsChanged() { 142 void BaseLayoutManager::OnDisplayWorkAreaInsetsChanged() {
143 AdjustAllWindowsBoundsForWorkAreaChange( 143 AdjustAllWindowsBoundsForWorkAreaChange(
144 ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED); 144 ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED);
(...skipping 20 matching lines...) Expand all
165 ShowStateChanged(window_state, old_state); 165 ShowStateChanged(window_state, old_state);
166 } 166 }
167 167
168 ////////////////////////////////////////////////////////////////////////////// 168 //////////////////////////////////////////////////////////////////////////////
169 // BaseLayoutManager, protected: 169 // BaseLayoutManager, protected:
170 170
171 void BaseLayoutManager::ShowStateChanged( 171 void BaseLayoutManager::ShowStateChanged(
172 wm::WindowState* window_state, 172 wm::WindowState* window_state,
173 ui::WindowShowState last_show_state) { 173 ui::WindowShowState last_show_state) {
174 if (window_state->IsMinimized()) { 174 if (window_state->IsMinimized()) {
175 if (last_show_state == ui::SHOW_STATE_MINIMIZED)
176 return;
177
175 // Save the previous show state so that we can correctly restore it. 178 // Save the previous show state so that we can correctly restore it.
176 window_state->window()->SetProperty(aura::client::kRestoreShowStateKey, 179 window_state->window()->SetProperty(aura::client::kRestoreShowStateKey,
177 last_show_state); 180 last_show_state);
178 views::corewm::SetWindowVisibilityAnimationType( 181 views::corewm::SetWindowVisibilityAnimationType(
179 window_state->window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); 182 window_state->window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE);
180 183
181 // Hide the window. 184 // Hide the window.
182 window_state->window()->Hide(); 185 window_state->window()->Hide();
183 // Activate another window. 186 // Activate another window.
184 if (window_state->IsActive()) 187 if (window_state->IsActive())
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 ScreenAsh::GetDisplayBoundsInParent(window)); 272 ScreenAsh::GetDisplayBoundsInParent(window));
270 break; 273 break;
271 274
272 default: 275 default:
273 break; 276 break;
274 } 277 }
275 } 278 }
276 279
277 } // namespace internal 280 } // namespace internal
278 } // namespace ash 281 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698