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

Unified Diff: ui/aura_shell/toplevel_layout_manager.cc

Issue 8873036: Create a visible shelf and constrain window movement (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup 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
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..0826c1d1361a316c176a92d79af208f268416d6b 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);
+ const gfx::Rect shelf_bounds = shelf_->GetLauncherBounds();
sky 2011/12/14 06:23:05 I think it would be better to ask for the screen w
DaveMoore 2011/12/14 17:03:19 Done.
+ if (child_bounds.y() < 0)
+ child_bounds.set_y(0);
+ else if (child_bounds.y() + kTitleHeight > shelf_bounds.y())
+ child_bounds.set_y(shelf_bounds.y() - kTitleHeight);
+ SetChildBoundsDirect(child, child_bounds);
}
void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window,

Powered by Google App Engine
This is Rietveld 408576698