| 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/ash_switches.h" | 7 #include "ash/common/ash_switches.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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 : GetDefaultRightSnappedWindowBoundsInParent(window); | 694 : GetDefaultRightSnappedWindowBoundsInParent(window); |
| 695 break; | 695 break; |
| 696 case WINDOW_STATE_TYPE_DOCKED: { | 696 case WINDOW_STATE_TYPE_DOCKED: { |
| 697 // TODO(afakhry): Remove in M58. | 697 // TODO(afakhry): Remove in M58. |
| 698 DCHECK(ash::switches::DockedWindowsEnabled()); | 698 DCHECK(ash::switches::DockedWindowsEnabled()); |
| 699 if (window->GetParent()->GetShellWindowId() != | 699 if (window->GetParent()->GetShellWindowId() != |
| 700 kShellWindowId_DockedContainer) { | 700 kShellWindowId_DockedContainer) { |
| 701 WmWindow* docked_container = | 701 WmWindow* docked_container = |
| 702 window->GetRootWindow()->GetChildByShellWindowId( | 702 window->GetRootWindow()->GetChildByShellWindowId( |
| 703 kShellWindowId_DockedContainer); | 703 kShellWindowId_DockedContainer); |
| 704 ReparentChildWithTransientChildren(window, window->GetParent(), | 704 ReparentChildWithTransientChildren(window->aura_window(), |
| 705 docked_container); | 705 window->aura_window()->parent(), |
| 706 docked_container->aura_window()); |
| 706 } | 707 } |
| 707 // Return early because we don't want to update the bounds of the | 708 // Return early because we don't want to update the bounds of the |
| 708 // window below; as the bounds are managed by the dock layout. | 709 // window below; as the bounds are managed by the dock layout. |
| 709 return; | 710 return; |
| 710 } | 711 } |
| 711 case WINDOW_STATE_TYPE_DEFAULT: | 712 case WINDOW_STATE_TYPE_DEFAULT: |
| 712 case WINDOW_STATE_TYPE_NORMAL: { | 713 case WINDOW_STATE_TYPE_NORMAL: { |
| 713 gfx::Rect work_area_in_parent = GetDisplayWorkAreaBoundsInParent(window); | 714 gfx::Rect work_area_in_parent = GetDisplayWorkAreaBoundsInParent(window); |
| 714 if (window_state->HasRestoreBounds()) { | 715 if (window_state->HasRestoreBounds()) { |
| 715 bounds_in_parent = window_state->GetRestoreBoundsInParent(); | 716 bounds_in_parent = window_state->GetRestoreBoundsInParent(); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); | 815 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); |
| 815 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); | 816 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); |
| 816 window_state->SetBoundsDirectAnimated(center_in_parent); | 817 window_state->SetBoundsDirectAnimated(center_in_parent); |
| 817 } | 818 } |
| 818 // Centering window is treated as if a user moved and resized the window. | 819 // Centering window is treated as if a user moved and resized the window. |
| 819 window_state->set_bounds_changed_by_user(true); | 820 window_state->set_bounds_changed_by_user(true); |
| 820 } | 821 } |
| 821 | 822 |
| 822 } // namespace wm | 823 } // namespace wm |
| 823 } // namespace ash | 824 } // namespace ash |
| OLD | NEW |