| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/lock_window_state.h" | 5 #include "ash/wm/lock_window_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/wm/common/window_animation_types.h" |
| 13 #include "ash/wm/common/window_state_util.h" |
| 12 #include "ash/wm/common/wm_event.h" | 14 #include "ash/wm/common/wm_event.h" |
| 13 #include "ash/wm/lock_layout_manager.h" | 15 #include "ash/wm/lock_layout_manager.h" |
| 14 #include "ash/wm/window_animations.h" | 16 #include "ash/wm/window_animations.h" |
| 15 #include "ash/wm/window_state.h" | 17 #include "ash/wm/window_state.h" |
| 16 #include "ash/wm/window_state_aura.h" | 18 #include "ash/wm/window_state_aura.h" |
| 17 #include "ash/wm/window_state_delegate.h" | 19 #include "ash/wm/window_state_delegate.h" |
| 18 #include "ash/wm/window_state_util.h" | |
| 19 #include "ash/wm/window_util.h" | 20 #include "ash/wm/window_util.h" |
| 20 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 21 #include "ui/aura/window_delegate.h" | 22 #include "ui/aura/window_delegate.h" |
| 22 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
| 23 #include "ui/keyboard/keyboard_controller.h" | 24 #include "ui/keyboard/keyboard_controller.h" |
| 24 #include "ui/keyboard/keyboard_util.h" | 25 #include "ui/keyboard/keyboard_util.h" |
| 25 #include "ui/wm/core/window_animations.h" | 26 #include "ui/wm/core/window_animations.h" |
| 26 | 27 |
| 27 namespace ash { | 28 namespace ash { |
| 28 | 29 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 (target_state == wm::WINDOW_STATE_TYPE_NORMAL && | 128 (target_state == wm::WINDOW_STATE_TYPE_NORMAL && |
| 128 !window_state->CanMaximize()) || | 129 !window_state->CanMaximize()) || |
| 129 target_state == wm::WINDOW_STATE_TYPE_FULLSCREEN); | 130 target_state == wm::WINDOW_STATE_TYPE_FULLSCREEN); |
| 130 | 131 |
| 131 if (target_state == wm::WINDOW_STATE_TYPE_MINIMIZED) { | 132 if (target_state == wm::WINDOW_STATE_TYPE_MINIMIZED) { |
| 132 if (current_state_type_ == wm::WINDOW_STATE_TYPE_MINIMIZED) | 133 if (current_state_type_ == wm::WINDOW_STATE_TYPE_MINIMIZED) |
| 133 return; | 134 return; |
| 134 | 135 |
| 135 current_state_type_ = target_state; | 136 current_state_type_ = target_state; |
| 136 ::wm::SetWindowVisibilityAnimationType( | 137 ::wm::SetWindowVisibilityAnimationType( |
| 137 window_state->aura_window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); | 138 window_state->aura_window(), |
| 139 wm::WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); |
| 138 window_state->window()->Hide(); | 140 window_state->window()->Hide(); |
| 139 if (window_state->IsActive()) | 141 if (window_state->IsActive()) |
| 140 window_state->Deactivate(); | 142 window_state->Deactivate(); |
| 141 return; | 143 return; |
| 142 } | 144 } |
| 143 | 145 |
| 144 if (current_state_type_ == target_state) { | 146 if (current_state_type_ == target_state) { |
| 145 // If the state type did not change, update it accordingly. | 147 // If the state type did not change, update it accordingly. |
| 146 UpdateBounds(window_state); | 148 UpdateBounds(window_state); |
| 147 return; | 149 return; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 gfx::Rect bounds = | 198 gfx::Rect bounds = |
| 197 ScreenUtil::GetShelfDisplayBoundsInRoot(window_state->aura_window()); | 199 ScreenUtil::GetShelfDisplayBoundsInRoot(window_state->aura_window()); |
| 198 | 200 |
| 199 bounds.set_height(bounds.height() - keyboard_bounds.height()); | 201 bounds.set_height(bounds.height() - keyboard_bounds.height()); |
| 200 | 202 |
| 201 VLOG(1) << "Updating window bounds to: " << bounds.ToString(); | 203 VLOG(1) << "Updating window bounds to: " << bounds.ToString(); |
| 202 window_state->SetBoundsDirect(bounds); | 204 window_state->SetBoundsDirect(bounds); |
| 203 } | 205 } |
| 204 | 206 |
| 205 } // namespace ash | 207 } // namespace ash |
| OLD | NEW |