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

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

Issue 10821008: ash: Window restore-bounds should not be reset when showing window from minimized state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | ash/wm/base_layout_manager_unittest.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/base_layout_manager.h" 5 #include "ash/wm/base_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/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/shelf_layout_manager.h" 10 #include "ash/wm/shelf_layout_manager.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ///////////////////////////////////////////////////////////////////////////// 128 /////////////////////////////////////////////////////////////////////////////
129 // BaseLayoutManager, WindowObserver overrides: 129 // BaseLayoutManager, WindowObserver overrides:
130 130
131 void BaseLayoutManager::OnWindowPropertyChanged(aura::Window* window, 131 void BaseLayoutManager::OnWindowPropertyChanged(aura::Window* window,
132 const void* key, 132 const void* key,
133 intptr_t old) { 133 intptr_t old) {
134 if (key == aura::client::kShowStateKey) { 134 if (key == aura::client::kShowStateKey) {
135 ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old); 135 ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old);
136 ui::WindowShowState new_state = 136 ui::WindowShowState new_state =
137 window->GetProperty(aura::client::kShowStateKey); 137 window->GetProperty(aura::client::kShowStateKey);
138 if (old_state != new_state && 138 if (old_state != new_state && old_state != ui::SHOW_STATE_MINIMIZED &&
139 ((new_state == ui::SHOW_STATE_MAXIMIZED && 139 ((new_state == ui::SHOW_STATE_MAXIMIZED &&
140 old_state != ui::SHOW_STATE_FULLSCREEN) || 140 old_state != ui::SHOW_STATE_FULLSCREEN) ||
141 (new_state == ui::SHOW_STATE_FULLSCREEN && 141 (new_state == ui::SHOW_STATE_FULLSCREEN &&
142 old_state != ui::SHOW_STATE_MAXIMIZED))) { 142 old_state != ui::SHOW_STATE_MAXIMIZED))) {
143 SetRestoreBoundsInParent(window, window->bounds()); 143 SetRestoreBoundsInParent(window, window->bounds());
144 } 144 }
145 // Minimized state handles its own animations. 145 // Minimized state handles its own animations.
146 bool animate = (old_state != ui::SHOW_STATE_MINIMIZED); 146 bool animate = (old_state != ui::SHOW_STATE_MINIMIZED);
147 UpdateBoundsFromShowState(window, animate); 147 UpdateBoundsFromShowState(window, animate);
148 ShowStateChanged(window, old_state); 148 ShowStateChanged(window, old_state);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 gfx::Rect display_rect = 253 gfx::Rect display_rect =
254 ScreenAsh::GetDisplayWorkAreaBoundsInParent(window); 254 ScreenAsh::GetDisplayWorkAreaBoundsInParent(window);
255 // Put as much of the window as possible within the display area. 255 // Put as much of the window as possible within the display area.
256 window->SetBounds(window->bounds().AdjustToFit(display_rect)); 256 window->SetBounds(window->bounds().AdjustToFit(display_rect));
257 } 257 }
258 } 258 }
259 } 259 }
260 260
261 } // namespace internal 261 } // namespace internal
262 } // namespace ash 262 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/base_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698