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

Unified Diff: ash/wm/window_positioner.cc

Issue 55303006: Make sure the non browser/non app widget is fully visible when created on ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell/toplevel_window.cc ('k') | ash/wm/window_positioner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_positioner.cc
diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc
index 58f4fb91dd54b12c19b1884dd03affe5d9aa365e..f5b0da6662ef5342da59c97fd4bd0a1125581797 100644
--- a/ash/wm/window_positioner.cc
+++ b/ash/wm/window_positioner.cc
@@ -283,11 +283,23 @@ bool WindowPositioner::DisableAutoPositioning(bool ignore) {
void WindowPositioner::RearrangeVisibleWindowOnShow(
aura::Window* added_window) {
wm::WindowState* added_window_state = wm::GetWindowState(added_window);
+ if (!added_window->TargetVisibility())
+ return;
if (!UseAutoWindowManager(added_window) ||
- added_window_state->bounds_changed_by_user() ||
- !added_window->TargetVisibility())
+ added_window_state->bounds_changed_by_user()) {
+ if (added_window_state->minimum_visibility()) {
+ // Guarante minimum visibility within the work area.
+ gfx::Rect work_area = GetWorkAreaForWindowInParent(added_window);
+ gfx::Rect bounds = added_window->bounds();
+ gfx::Rect new_bounds = bounds;
+ ash::wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area,
+ &new_bounds);
+ if (new_bounds != bounds)
+ added_window->SetBounds(new_bounds);
+ }
return;
+ }
// Find a single open managed window.
bool single_window;
aura::Window* other_shown_window = GetReferenceWindow(
« no previous file with comments | « ash/shell/toplevel_window.cc ('k') | ash/wm/window_positioner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698