OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/aura_shell/status_area_layout_manager.h" | |
6 | |
7 #include "base/auto_reset.h" | |
8 #include "ui/aura_shell/shelf_layout_manager.h" | |
9 | |
10 namespace aura_shell { | |
11 namespace internal { | |
12 | |
13 //////////////////////////////////////////////////////////////////////////////// | |
14 // StatusAreaLayoutManager, public: | |
15 | |
16 StatusAreaLayoutManager::StatusAreaLayoutManager(ShelfLayoutManager* shelf) | |
17 : in_layout_(false), | |
18 shelf_(shelf) { | |
19 } | |
20 | |
21 StatusAreaLayoutManager::~StatusAreaLayoutManager() { | |
22 } | |
23 | |
24 //////////////////////////////////////////////////////////////////////////////// | |
25 // StatusAreaLayoutManager, aura::LayoutManager implementation: | |
26 | |
27 void StatusAreaLayoutManager::OnWindowResized() { | |
28 LayoutStatusArea(); | |
29 } | |
30 | |
31 void StatusAreaLayoutManager::OnWindowAddedToLayout(aura::Window* child) { | |
32 } | |
33 | |
34 void StatusAreaLayoutManager::OnWillRemoveWindowFromLayout( | |
35 aura::Window* child) { | |
36 } | |
37 | |
38 void StatusAreaLayoutManager::OnChildWindowVisibilityChanged( | |
39 aura::Window* child, bool visible) { | |
40 } | |
41 | |
42 void StatusAreaLayoutManager::SetChildBounds( | |
43 aura::Window* child, const gfx::Rect& requested_bounds) { | |
44 SetChildBoundsDirect(child, requested_bounds); | |
45 if (!in_layout_) | |
46 LayoutStatusArea(); | |
47 } | |
48 | |
49 //////////////////////////////////////////////////////////////////////////////// | |
50 // StatusAreaLayoutManager, private: | |
51 | |
52 void StatusAreaLayoutManager::LayoutStatusArea() { | |
53 // Shelf layout manager may be already doing layout. | |
54 if (shelf_->in_layout()) | |
55 return; | |
56 | |
57 AutoReset<bool> auto_reset_in_layout(&in_layout_, true); | |
58 shelf_->LayoutShelf(); | |
59 } | |
60 | |
61 } // internal | |
62 } // aura_shell | |
OLD | NEW |