| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |