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

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

Issue 2593953002: ash: Fix status bubble is vertically offset after switching desktops (Closed)
Patch Set: add test coverage Created 3 years, 11 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 | « no previous file | ash/common/wm/workspace/workspace_layout_manager_unittest.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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/common/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698