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

Unified Diff: ui/aura_shell/toplevel_layout_manager.cc

Issue 8914023: Relands fixes for 106432, 107287 and 107401. These got reverted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Da fix Created 9 years 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 | « ui/aura_shell/test/test_shell_delegate.cc ('k') | ui/resources/aura/launcher_background.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/toplevel_layout_manager.cc
diff --git a/ui/aura_shell/toplevel_layout_manager.cc b/ui/aura_shell/toplevel_layout_manager.cc
index 05d5f474c23de0cebb1c12be25236c296ed5cd6d..00b44aa0bce7d2717100a631369bb6827f26fcee 100644
--- a/ui/aura_shell/toplevel_layout_manager.cc
+++ b/ui/aura_shell/toplevel_layout_manager.cc
@@ -48,7 +48,14 @@ void ToplevelLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child,
void ToplevelLayoutManager::SetChildBounds(aura::Window* child,
const gfx::Rect& requested_bounds) {
- SetChildBoundsDirect(child, requested_bounds);
+ const static int kTitleHeight = 12;
+ gfx::Rect child_bounds(requested_bounds);
+ gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestWindow(child);
+ if (child_bounds.y() < 0)
+ child_bounds.set_y(0);
+ else if (child_bounds.y() + kTitleHeight > work_area.bottom())
+ child_bounds.set_y(work_area.bottom() - kTitleHeight);
+ SetChildBoundsDirect(child, child_bounds);
}
void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window,
« no previous file with comments | « ui/aura_shell/test/test_shell_delegate.cc ('k') | ui/resources/aura/launcher_background.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698