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/common/system/tray/tri_view.h" | 5 #include "ash/common/system/tray/tri_view.h" |
6 | 6 |
7 #include "ash/common/system/tray/size_range_layout.h" | 7 #include "ash/common/system/tray/size_range_layout.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ui/views/border.h" | 9 #include "ui/views/border.h" |
10 #include "ui/views/layout/box_layout.h" | 10 #include "ui/views/layout/box_layout.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); | 71 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); |
72 SetLayoutManager(box_layout_); | 72 SetLayoutManager(box_layout_); |
73 | 73 |
74 enable_hierarchy_changed_dcheck_ = true; | 74 enable_hierarchy_changed_dcheck_ = true; |
75 } | 75 } |
76 | 76 |
77 TriView::~TriView() { | 77 TriView::~TriView() { |
78 enable_hierarchy_changed_dcheck_ = false; | 78 enable_hierarchy_changed_dcheck_ = false; |
79 } | 79 } |
80 | 80 |
| 81 void TriView::SetMinHeight(int height) { |
| 82 gfx::Size min_size; |
| 83 |
| 84 min_size = GetMinSize(TriView::Container::START); |
| 85 min_size.set_height(height); |
| 86 SetMinSize(TriView::Container::START, min_size); |
| 87 |
| 88 min_size = GetMinSize(TriView::Container::CENTER); |
| 89 min_size.set_height(height); |
| 90 SetMinSize(TriView::Container::CENTER, min_size); |
| 91 |
| 92 min_size = GetMinSize(TriView::Container::END); |
| 93 min_size.set_height(height); |
| 94 SetMinSize(TriView::Container::END, min_size); |
| 95 } |
| 96 |
81 void TriView::SetMinSize(Container container, const gfx::Size& size) { | 97 void TriView::SetMinSize(Container container, const gfx::Size& size) { |
82 GetLayoutManager(container)->SetMinSize(size); | 98 GetLayoutManager(container)->SetMinSize(size); |
83 } | 99 } |
84 | 100 |
85 gfx::Size TriView::GetMinSize(Container container) { | 101 gfx::Size TriView::GetMinSize(Container container) { |
86 return GetLayoutManager(container)->min_size(); | 102 return GetLayoutManager(container)->min_size(); |
87 } | 103 } |
88 | 104 |
89 void TriView::SetMaxSize(Container container, const gfx::Size& size) { | 105 void TriView::SetMaxSize(Container container, const gfx::Size& size) { |
90 GetLayoutManager(container)->SetMaxSize(size); | 106 GetLayoutManager(container)->SetMaxSize(size); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return center_container_layout_manager_; | 170 return center_container_layout_manager_; |
155 case Container::END: | 171 case Container::END: |
156 return end_container_layout_manager_; | 172 return end_container_layout_manager_; |
157 } | 173 } |
158 // Required for some compilers. | 174 // Required for some compilers. |
159 NOTREACHED(); | 175 NOTREACHED(); |
160 return nullptr; | 176 return nullptr; |
161 } | 177 } |
162 | 178 |
163 } // namespace ash | 179 } // namespace ash |
OLD | NEW |