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

Side by Side Diff: ash/wm/status_area_layout_manager.cc

Issue 10384217: Add left/right layout support for uber tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: UpdateWidgetSize when layout manager is changed for systemtray and add test. Created 8 years, 7 months 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
« no previous file with comments | « ash/wm/shelf_layout_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/wm/status_area_layout_manager.h" 5 #include "ash/wm/status_area_layout_manager.h"
6 6
7 #include "ash/wm/shelf_layout_manager.h" 7 #include "ash/wm/shelf_layout_manager.h"
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 const gfx::Rect& requested_bounds) { 49 const gfx::Rect& requested_bounds) {
50 // Only need to have the shelf do a layout if the child changing is the status 50 // Only need to have the shelf do a layout if the child changing is the status
51 // area and the shelf isn't in the process of doing a layout. 51 // area and the shelf isn't in the process of doing a layout.
52 if (child != shelf_->status()->GetNativeView() || in_layout_) { 52 if (child != shelf_->status()->GetNativeView() || in_layout_) {
53 SetChildBoundsDirect(child, requested_bounds); 53 SetChildBoundsDirect(child, requested_bounds);
54 return; 54 return;
55 } 55 }
56 56
57 // If the size matches, no need to do anything. We don't check the location as 57 // If the size matches, no need to do anything. We don't check the location as
58 // that is managed by the shelf. 58 // that is managed by the shelf.
59 if (requested_bounds.size() == child->bounds().size()) 59 if (requested_bounds == child->bounds())
60 return; 60 return;
61 61
62 SetChildBoundsDirect(child, requested_bounds); 62 SetChildBoundsDirect(child, requested_bounds);
63 LayoutStatusArea(); 63 LayoutStatusArea();
64 } 64 }
65 65
66 //////////////////////////////////////////////////////////////////////////////// 66 ////////////////////////////////////////////////////////////////////////////////
67 // StatusAreaLayoutManager, private: 67 // StatusAreaLayoutManager, private:
68 68
69 void StatusAreaLayoutManager::LayoutStatusArea() { 69 void StatusAreaLayoutManager::LayoutStatusArea() {
70 // Shelf layout manager may be already doing layout. 70 // Shelf layout manager may be already doing layout.
71 if (shelf_->in_layout()) 71 if (shelf_->in_layout())
72 return; 72 return;
73 73
74 AutoReset<bool> auto_reset_in_layout(&in_layout_, true); 74 AutoReset<bool> auto_reset_in_layout(&in_layout_, true);
75 shelf_->LayoutShelf(); 75 shelf_->LayoutShelf();
76 } 76 }
77 77
78 } // namespace internal 78 } // namespace internal
79 } // namespace ash 79 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/shelf_layout_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698