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

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

Issue 2932053003: [ash] Made TriView's re-layout automatically when a child container's visibility changes. (Closed)
Patch Set: Fixed compile error. Created 3 years, 6 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/tri_view.h ('k') | ash/system/tray/tri_view_unittest.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/tri_view.h" 5 #include "ash/system/tray/tri_view.h"
6 6
7 #include "ash/system/tray/size_range_layout.h" 7 #include "ash/system/tray/size_range_layout.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ui/gfx/geometry/insets.h" 9 #include "ui/gfx/geometry/insets.h"
10 #include "ui/views/border.h" 10 #include "ui/views/border.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 void TriView::SetInsets(const gfx::Insets& insets) { 117 void TriView::SetInsets(const gfx::Insets& insets) {
118 box_layout_->set_inside_border_insets(insets); 118 box_layout_->set_inside_border_insets(insets);
119 } 119 }
120 120
121 void TriView::SetContainerBorder(Container container, 121 void TriView::SetContainerBorder(Container container,
122 std::unique_ptr<views::Border> border) { 122 std::unique_ptr<views::Border> border) {
123 GetContainer(container)->SetBorder(std::move(border)); 123 GetContainer(container)->SetBorder(std::move(border));
124 } 124 }
125 125
126 void TriView::SetContainerVisible(Container container, bool visible) { 126 void TriView::SetContainerVisible(Container container, bool visible) {
127 if (GetContainer(container)->visible() == visible)
128 return;
127 GetContainer(container)->SetVisible(visible); 129 GetContainer(container)->SetVisible(visible);
130 Layout();
128 } 131 }
129 132
130 void TriView::SetFlexForContainer(Container container, int flex) { 133 void TriView::SetFlexForContainer(Container container, int flex) {
131 box_layout_->SetFlexForView(GetContainer(container), flex); 134 box_layout_->SetFlexForView(GetContainer(container), flex);
132 } 135 }
133 136
134 void TriView::SetContainerLayout( 137 void TriView::SetContainerLayout(
135 Container container, 138 Container container,
136 std::unique_ptr<views::LayoutManager> layout_manager) { 139 std::unique_ptr<views::LayoutManager> layout_manager) {
137 GetLayoutManager(container)->SetLayoutManager(std::move(layout_manager)); 140 GetLayoutManager(container)->SetLayoutManager(std::move(layout_manager));
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 return center_container_layout_manager_; 173 return center_container_layout_manager_;
171 case Container::END: 174 case Container::END:
172 return end_container_layout_manager_; 175 return end_container_layout_manager_;
173 } 176 }
174 // Required for some compilers. 177 // Required for some compilers.
175 NOTREACHED(); 178 NOTREACHED();
176 return nullptr; 179 return nullptr;
177 } 180 }
178 181
179 } // namespace ash 182 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tri_view.h ('k') | ash/system/tray/tri_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698