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

Side by Side Diff: ash/system/tray/tray_container.cc

Issue 2899253002: chromeos: Rename ash::WmShelf to Shelf (Closed)
Patch Set: rebase Created 3 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
« no previous file with comments | « ash/system/tray/tray_container.h ('k') | ash/system/tray/tray_item_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/system/tray/tray_container.h" 5 #include "ash/system/tray/tray_container.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/shelf/wm_shelf.h" 9 #include "ash/shelf/shelf.h"
10 #include "ash/system/tray/tray_constants.h" 10 #include "ash/system/tray/tray_constants.h"
11 #include "ui/gfx/geometry/insets.h" 11 #include "ui/gfx/geometry/insets.h"
12 #include "ui/views/border.h" 12 #include "ui/views/border.h"
13 #include "ui/views/layout/box_layout.h" 13 #include "ui/views/layout/box_layout.h"
14 14
15 namespace ash { 15 namespace ash {
16 16
17 TrayContainer::TrayContainer(WmShelf* wm_shelf) : wm_shelf_(wm_shelf) { 17 TrayContainer::TrayContainer(Shelf* shelf) : shelf_(shelf) {
18 DCHECK(wm_shelf_); 18 DCHECK(shelf_);
19 19
20 UpdateLayout(); 20 UpdateLayout();
21 } 21 }
22 22
23 TrayContainer::~TrayContainer() {} 23 TrayContainer::~TrayContainer() {}
24 24
25 void TrayContainer::UpdateAfterShelfAlignmentChange() { 25 void TrayContainer::UpdateAfterShelfAlignmentChange() {
26 UpdateLayout(); 26 UpdateLayout();
27 } 27 }
28 28
(...skipping 11 matching lines...) Expand all
40 PreferredSizeChanged(); 40 PreferredSizeChanged();
41 } 41 }
42 42
43 void TrayContainer::ViewHierarchyChanged( 43 void TrayContainer::ViewHierarchyChanged(
44 const ViewHierarchyChangedDetails& details) { 44 const ViewHierarchyChangedDetails& details) {
45 if (details.parent == this) 45 if (details.parent == this)
46 PreferredSizeChanged(); 46 PreferredSizeChanged();
47 } 47 }
48 48
49 void TrayContainer::UpdateLayout() { 49 void TrayContainer::UpdateLayout() {
50 const bool is_horizontal = wm_shelf_->IsHorizontalAlignment(); 50 const bool is_horizontal = shelf_->IsHorizontalAlignment();
51 51
52 // Adjust the size of status tray dark background by adding additional 52 // Adjust the size of status tray dark background by adding additional
53 // empty border. 53 // empty border.
54 views::BoxLayout::Orientation orientation = 54 views::BoxLayout::Orientation orientation =
55 is_horizontal ? views::BoxLayout::kHorizontal 55 is_horizontal ? views::BoxLayout::kHorizontal
56 : views::BoxLayout::kVertical; 56 : views::BoxLayout::kVertical;
57 57
58 const int hit_region_with_separator = kHitRegionPadding + kSeparatorWidth; 58 const int hit_region_with_separator = kHitRegionPadding + kSeparatorWidth;
59 gfx::Insets insets( 59 gfx::Insets insets(
60 is_horizontal 60 is_horizontal
(...skipping 10 matching lines...) Expand all
71 views::BoxLayout* layout = 71 views::BoxLayout* layout =
72 new views::BoxLayout(orientation, horizontal_margin, vertical_margin, 0); 72 new views::BoxLayout(orientation, horizontal_margin, vertical_margin, 0);
73 73
74 layout->set_minimum_cross_axis_size(kTrayItemSize); 74 layout->set_minimum_cross_axis_size(kTrayItemSize);
75 views::View::SetLayoutManager(layout); 75 views::View::SetLayoutManager(layout);
76 76
77 PreferredSizeChanged(); 77 PreferredSizeChanged();
78 } 78 }
79 79
80 } // namespace ash 80 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_container.h ('k') | ash/system/tray/tray_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698