| 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/workspace/workspace_layout_manager2.h" | 5 #include "ash/wm/workspace/workspace_layout_manager2.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
| 10 #include "ash/wm/always_on_top_controller.h" | 10 #include "ash/wm/always_on_top_controller.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 intptr_t old) { | 129 intptr_t old) { |
| 130 if (key == aura::client::kShowStateKey) { | 130 if (key == aura::client::kShowStateKey) { |
| 131 ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old); | 131 ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old); |
| 132 ui::WindowShowState new_state = | 132 ui::WindowShowState new_state = |
| 133 window->GetProperty(aura::client::kShowStateKey); | 133 window->GetProperty(aura::client::kShowStateKey); |
| 134 if (old_state == ui::SHOW_STATE_MINIMIZED) { | 134 if (old_state == ui::SHOW_STATE_MINIMIZED) { |
| 135 window->layer()->SetOpacity(1.0f); | 135 window->layer()->SetOpacity(1.0f); |
| 136 window->layer()->SetTransform(ui::Transform()); | 136 window->layer()->SetTransform(ui::Transform()); |
| 137 } | 137 } |
| 138 if (old_state != ui::SHOW_STATE_MINIMIZED && | 138 if (old_state != ui::SHOW_STATE_MINIMIZED && |
| 139 GetRestoreBoundsInScreen(window) == NULL && |
| 139 WorkspaceManager2::IsMaximizedState(new_state) && | 140 WorkspaceManager2::IsMaximizedState(new_state) && |
| 140 !WorkspaceManager2::IsMaximizedState(old_state)) { | 141 !WorkspaceManager2::IsMaximizedState(old_state)) { |
| 141 SetRestoreBoundsInParent(window, window->bounds()); | 142 SetRestoreBoundsInParent(window, window->bounds()); |
| 142 } | 143 } |
| 143 | 144 |
| 144 // If maximizing or restoring, clone the layer. WorkspaceManager will use it | 145 // If maximizing or restoring, clone the layer. WorkspaceManager will use it |
| 145 // (and take overship of it) when animating. Ideally we could use that of | 146 // (and take overship of it) when animating. Ideally we could use that of |
| 146 // BaseLayoutManager, but that proves problematic. In particular when | 147 // BaseLayoutManager, but that proves problematic. In particular when |
| 147 // restoring we need to animate on top of the workspace animating in. | 148 // restoring we need to animate on top of the workspace animating in. |
| 148 ui::Layer* cloned_layer = NULL; | 149 ui::Layer* cloned_layer = NULL; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 274 } |
| 274 return false; | 275 return false; |
| 275 } | 276 } |
| 276 | 277 |
| 277 WorkspaceManager2* WorkspaceLayoutManager2::workspace_manager() { | 278 WorkspaceManager2* WorkspaceLayoutManager2::workspace_manager() { |
| 278 return workspace_->workspace_manager(); | 279 return workspace_->workspace_manager(); |
| 279 } | 280 } |
| 280 | 281 |
| 281 } // namespace internal | 282 } // namespace internal |
| 282 } // namespace ash | 283 } // namespace ash |
| OLD | NEW |