| 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/wm/dock/docked_window_layout_manager.h" | 7 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
| 8 #include "ash/common/wm/window_animation_types.h" | 8 #include "ash/common/wm/window_animation_types.h" |
| 9 #include "ash/common/wm/window_parenting_utils.h" | 9 #include "ash/common/wm/window_parenting_utils.h" |
| 10 #include "ash/common/wm/window_positioning_utils.h" | 10 #include "ash/common/wm/window_positioning_utils.h" |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 if (in_fullscreen && window_state->IsMaximized()) | 470 if (in_fullscreen && window_state->IsMaximized()) |
| 471 return true; | 471 return true; |
| 472 | 472 |
| 473 if (window_state->is_dragged() || | 473 if (window_state->is_dragged() || |
| 474 SetMaximizedOrFullscreenBounds(window_state)) { | 474 SetMaximizedOrFullscreenBounds(window_state)) { |
| 475 return true; | 475 return true; |
| 476 } | 476 } |
| 477 gfx::Rect work_area_in_parent = | 477 gfx::Rect work_area_in_parent = |
| 478 GetDisplayWorkAreaBoundsInParent(window_state->window()); | 478 GetDisplayWorkAreaBoundsInParent(window_state->window()); |
| 479 gfx::Rect bounds = window_state->window()->GetTargetBounds(); | 479 gfx::Rect bounds = window_state->window()->GetTargetBounds(); |
| 480 wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent, | 480 if (!window_state->window()->GetTransientParent()) { |
| 481 &bounds); | 481 wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent, |
| 482 &bounds); |
| 483 } |
| 482 window_state->AdjustSnappedBounds(&bounds); | 484 window_state->AdjustSnappedBounds(&bounds); |
| 483 if (window_state->window()->GetTargetBounds() != bounds) | 485 if (window_state->window()->GetTargetBounds() != bounds) |
| 484 window_state->SetBoundsDirectAnimated(bounds); | 486 window_state->SetBoundsDirectAnimated(bounds); |
| 485 return true; | 487 return true; |
| 486 } | 488 } |
| 487 case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION: | 489 case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION: |
| 488 case WM_EVENT_TOGGLE_MAXIMIZE: | 490 case WM_EVENT_TOGGLE_MAXIMIZE: |
| 489 case WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE: | 491 case WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE: |
| 490 case WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE: | 492 case WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE: |
| 491 case WM_EVENT_TOGGLE_FULLSCREEN: | 493 case WM_EVENT_TOGGLE_FULLSCREEN: |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); | 770 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); |
| 769 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); | 771 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); |
| 770 window_state->SetBoundsDirectAnimated(center_in_parent); | 772 window_state->SetBoundsDirectAnimated(center_in_parent); |
| 771 } | 773 } |
| 772 // Centering window is treated as if a user moved and resized the window. | 774 // Centering window is treated as if a user moved and resized the window. |
| 773 window_state->set_bounds_changed_by_user(true); | 775 window_state->set_bounds_changed_by_user(true); |
| 774 } | 776 } |
| 775 | 777 |
| 776 } // namespace wm | 778 } // namespace wm |
| 777 } // namespace ash | 779 } // namespace ash |
| OLD | NEW |