| 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/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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // BaseLayoutManager, WindowObserver overrides: | 130 // BaseLayoutManager, WindowObserver overrides: |
| 131 | 131 |
| 132 void BaseLayoutManager::OnWindowPropertyChanged(aura::Window* window, | 132 void BaseLayoutManager::OnWindowPropertyChanged(aura::Window* window, |
| 133 const void* key, | 133 const void* key, |
| 134 intptr_t old) { | 134 intptr_t old) { |
| 135 if (key == aura::client::kShowStateKey) { | 135 if (key == aura::client::kShowStateKey) { |
| 136 ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old); | 136 ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old); |
| 137 ui::WindowShowState new_state = | 137 ui::WindowShowState new_state = |
| 138 window->GetProperty(aura::client::kShowStateKey); | 138 window->GetProperty(aura::client::kShowStateKey); |
| 139 if (old_state != new_state && old_state != ui::SHOW_STATE_MINIMIZED && | 139 if (old_state != new_state && old_state != ui::SHOW_STATE_MINIMIZED && |
| 140 !GetRestoreBoundsInScreen(window) && |
| 140 ((new_state == ui::SHOW_STATE_MAXIMIZED && | 141 ((new_state == ui::SHOW_STATE_MAXIMIZED && |
| 141 old_state != ui::SHOW_STATE_FULLSCREEN) || | 142 old_state != ui::SHOW_STATE_FULLSCREEN) || |
| 142 (new_state == ui::SHOW_STATE_FULLSCREEN && | 143 (new_state == ui::SHOW_STATE_FULLSCREEN && |
| 143 old_state != ui::SHOW_STATE_MAXIMIZED))) { | 144 old_state != ui::SHOW_STATE_MAXIMIZED))) { |
| 144 SetRestoreBoundsInParent(window, window->bounds()); | 145 SetRestoreBoundsInParent(window, window->bounds()); |
| 145 } | 146 } |
| 146 // Minimized state handles its own animations. | 147 // Minimized state handles its own animations. |
| 147 // TODO(sky): get animations to work with Workspace2. | 148 // TODO(sky): get animations to work with Workspace2. |
| 148 bool animate = (old_state != ui::SHOW_STATE_MINIMIZED) && | 149 bool animate = (old_state != ui::SHOW_STATE_MINIMIZED) && |
| 149 !WorkspaceController::IsWorkspace2Enabled(); | 150 !WorkspaceController::IsWorkspace2Enabled(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 gfx::Rect display_rect = | 257 gfx::Rect display_rect = |
| 257 ScreenAsh::GetDisplayWorkAreaBoundsInParent(window); | 258 ScreenAsh::GetDisplayWorkAreaBoundsInParent(window); |
| 258 // Put as much of the window as possible within the display area. | 259 // Put as much of the window as possible within the display area. |
| 259 window->SetBounds(window->bounds().AdjustToFit(display_rect)); | 260 window->SetBounds(window->bounds().AdjustToFit(display_rect)); |
| 260 } | 261 } |
| 261 } | 262 } |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace internal | 265 } // namespace internal |
| 265 } // namespace ash | 266 } // namespace ash |
| OLD | NEW |