| 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/common/wm/default_state.h" | 5 #include "ash/common/wm/default_state.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
| 8 #include "ash/common/wm/dock/docked_window_layout_manager.h" | 8 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
| 9 #include "ash/common/wm/window_animation_types.h" | 9 #include "ash/common/wm/window_animation_types.h" |
| 10 #include "ash/common/wm/window_parenting_utils.h" | 10 #include "ash/common/wm/window_parenting_utils.h" |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 window->SetVisibilityAnimationType( | 728 window->SetVisibilityAnimationType( |
| 729 WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); | 729 WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); |
| 730 | 730 |
| 731 // Hide the window. | 731 // Hide the window. |
| 732 window->Hide(); | 732 window->Hide(); |
| 733 // Activate another window. | 733 // Activate another window. |
| 734 if (window_state->IsActive()) | 734 if (window_state->IsActive()) |
| 735 window_state->Deactivate(); | 735 window_state->Deactivate(); |
| 736 } else if ((window->GetTargetVisibility() || | 736 } else if ((window->GetTargetVisibility() || |
| 737 IsMinimizedWindowState(previous_state_type)) && | 737 IsMinimizedWindowState(previous_state_type)) && |
| 738 !window->GetLayer()->visible()) { | 738 !window->GetLayerVisible()) { |
| 739 // The layer may be hidden if the window was previously minimized. Make | 739 // The layer may be hidden if the window was previously minimized. Make |
| 740 // sure it's visible. | 740 // sure it's visible. |
| 741 window->Show(); | 741 window->Show(); |
| 742 if (IsMinimizedWindowState(previous_state_type) && | 742 if (IsMinimizedWindowState(previous_state_type) && |
| 743 !window_state->IsMaximizedOrFullscreenOrPinned()) { | 743 !window_state->IsMaximizedOrFullscreenOrPinned()) { |
| 744 window_state->set_unminimize_to_restore_bounds(false); | 744 window_state->set_unminimize_to_restore_bounds(false); |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 } | 747 } |
| 748 | 748 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 763 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); | 763 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); |
| 764 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); | 764 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); |
| 765 window_state->SetBoundsDirectAnimated(center_in_parent); | 765 window_state->SetBoundsDirectAnimated(center_in_parent); |
| 766 } | 766 } |
| 767 // Centering window is treated as if a user moved and resized the window. | 767 // Centering window is treated as if a user moved and resized the window. |
| 768 window_state->set_bounds_changed_by_user(true); | 768 window_state->set_bounds_changed_by_user(true); |
| 769 } | 769 } |
| 770 | 770 |
| 771 } // namespace wm | 771 } // namespace wm |
| 772 } // namespace ash | 772 } // namespace ash |
| OLD | NEW |