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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura_shell/toplevel_layout_manager.h" 5 #include "ui/aura_shell/toplevel_layout_manager.h"
6 6
7 #include "ui/aura/client/aura_constants.h" 7 #include "ui/aura/client/aura_constants.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura_shell/property_util.h" 9 #include "ui/aura_shell/property_util.h"
10 #include "ui/aura_shell/shelf_layout_manager.h" 10 #include "ui/aura_shell/shelf_layout_manager.h"
(...skipping 30 matching lines...) Expand all
41 UpdateShelfVisibility(); 41 UpdateShelfVisibility();
42 } 42 }
43 43
44 void ToplevelLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, 44 void ToplevelLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child,
45 bool visibile) { 45 bool visibile) {
46 UpdateShelfVisibility(); 46 UpdateShelfVisibility();
47 } 47 }
48 48
49 void ToplevelLayoutManager::SetChildBounds(aura::Window* child, 49 void ToplevelLayoutManager::SetChildBounds(aura::Window* child,
50 const gfx::Rect& requested_bounds) { 50 const gfx::Rect& requested_bounds) {
51 SetChildBoundsDirect(child, requested_bounds); 51 const static int kTitleHeight = 12;
52 gfx::Rect child_bounds(requested_bounds);
53 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.
54 if (child_bounds.y() < 0)
55 child_bounds.set_y(0);
56 else if (child_bounds.y() + kTitleHeight > shelf_bounds.y())
57 child_bounds.set_y(shelf_bounds.y() - kTitleHeight);
58 SetChildBoundsDirect(child, child_bounds);
52 } 59 }
53 60
54 void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window, 61 void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window,
55 const char* name, 62 const char* name,
56 void* old) { 63 void* old) {
57 if (name == aura::kShowStateKey) 64 if (name == aura::kShowStateKey)
58 WindowStateChanged(window); 65 WindowStateChanged(window);
59 } 66 }
60 67
61 void ToplevelLayoutManager::WindowStateChanged(aura::Window* window) { 68 void ToplevelLayoutManager::WindowStateChanged(aura::Window* window) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 ui::SHOW_STATE_FULLSCREEN) { 103 ui::SHOW_STATE_FULLSCREEN) {
97 has_fullscreen_window = true; 104 has_fullscreen_window = true;
98 break; 105 break;
99 } 106 }
100 } 107 }
101 shelf_->SetVisible(!has_fullscreen_window); 108 shelf_->SetVisible(!has_fullscreen_window);
102 } 109 }
103 110
104 } // namespace internal 111 } // namespace internal
105 } // namespace aura_shell 112 } // namespace aura_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698