Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: ash/common/wm/default_state.cc

Issue 2391153002: Converts most of WorkspaceLayoutManager tests to use common code (Closed)
Patch Set: merge Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/test/ash_test_impl.h ('k') | ash/common/wm/fullscreen_window_finder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/common/test/ash_test_impl.h ('k') | ash/common/wm/fullscreen_window_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698