Chromium Code Reviews| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 469 if (window_state->is_dragged() || | 469 if (window_state->is_dragged() || |
| 470 SetMaximizedOrFullscreenBounds(window_state)) { | 470 SetMaximizedOrFullscreenBounds(window_state)) { |
| 471 return true; | 471 return true; |
| 472 } | 472 } |
| 473 gfx::Rect work_area_in_parent = | 473 gfx::Rect work_area_in_parent = |
| 474 GetDisplayWorkAreaBoundsInParent(window_state->window()); | 474 GetDisplayWorkAreaBoundsInParent(window_state->window()); |
| 475 gfx::Rect bounds = window_state->window()->GetBounds(); | 475 gfx::Rect bounds = window_state->window()->GetBounds(); |
| 476 wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent, | 476 wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent, |
| 477 &bounds); | 477 &bounds); |
| 478 window_state->AdjustSnappedBounds(&bounds); | 478 window_state->AdjustSnappedBounds(&bounds); |
| 479 if (window_state->window()->GetBounds() != bounds) | 479 if (window_state->window()->GetBounds() != bounds && |
| 480 !window_state->ignored_by_shelf()) | |
|
sky
2016/08/25 15:19:30
ignored_by_shelf means:
// True if the window i
| |
| 480 window_state->SetBoundsDirectAnimated(bounds); | 481 window_state->SetBoundsDirectAnimated(bounds); |
| 481 return true; | 482 return true; |
| 482 } | 483 } |
| 483 case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION: | 484 case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION: |
| 484 case WM_EVENT_TOGGLE_MAXIMIZE: | 485 case WM_EVENT_TOGGLE_MAXIMIZE: |
| 485 case WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE: | 486 case WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE: |
| 486 case WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE: | 487 case WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE: |
| 487 case WM_EVENT_TOGGLE_FULLSCREEN: | 488 case WM_EVENT_TOGGLE_FULLSCREEN: |
| 488 case WM_EVENT_CYCLE_SNAP_DOCK_LEFT: | 489 case WM_EVENT_CYCLE_SNAP_DOCK_LEFT: |
| 489 case WM_EVENT_CYCLE_SNAP_DOCK_RIGHT: | 490 case WM_EVENT_CYCLE_SNAP_DOCK_RIGHT: |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 753 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); | 754 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); |
| 754 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); | 755 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); |
| 755 window_state->SetBoundsDirectAnimated(center_in_parent); | 756 window_state->SetBoundsDirectAnimated(center_in_parent); |
| 756 } | 757 } |
| 757 // Centering window is treated as if a user moved and resized the window. | 758 // Centering window is treated as if a user moved and resized the window. |
| 758 window_state->set_bounds_changed_by_user(true); | 759 window_state->set_bounds_changed_by_user(true); |
| 759 } | 760 } |
| 760 | 761 |
| 761 } // namespace wm | 762 } // namespace wm |
| 762 } // namespace ash | 763 } // namespace ash |
| OLD | NEW |