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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 | 106 |
107 void TriView::SetFlexForContainer(Container container, int flex) { | 107 void TriView::SetFlexForContainer(Container container, int flex) { |
108 box_layout_->SetFlexForView(GetContainer(container), flex); | 108 box_layout_->SetFlexForView(GetContainer(container), flex); |
109 } | 109 } |
110 | 110 |
111 void TriView::SetContainerLayout( | 111 void TriView::SetContainerLayout( |
112 Container container, | 112 Container container, |
113 std::unique_ptr<views::LayoutManager> layout_manager) { | 113 std::unique_ptr<views::LayoutManager> layout_manager) { |
114 GetLayoutManager(container)->SetLayoutManager(std::move(layout_manager)); | 114 GetLayoutManager(container)->SetLayoutManager(std::move(layout_manager)); |
115 if (GetLayoutManager(container)) | |
116 GetLayoutManager(container)->Installed(GetContainer(container)); | |
117 } | 115 } |
118 | 116 |
119 void TriView::ViewHierarchyChanged( | 117 void TriView::ViewHierarchyChanged( |
120 const views::View::ViewHierarchyChangedDetails& details) { | 118 const views::View::ViewHierarchyChangedDetails& details) { |
121 views::View::ViewHierarchyChanged(details); | 119 views::View::ViewHierarchyChanged(details); |
122 if (!enable_hierarchy_changed_dcheck_) | 120 if (!enable_hierarchy_changed_dcheck_) |
123 return; | 121 return; |
124 | 122 |
125 if (details.parent == this) { | 123 if (details.parent == this) { |
126 if (details.is_add) { | 124 if (details.is_add) { |
(...skipping 29 matching lines...) Expand all Loading... |
156 return center_container_layout_manager_; | 154 return center_container_layout_manager_; |
157 case Container::END: | 155 case Container::END: |
158 return end_container_layout_manager_; | 156 return end_container_layout_manager_; |
159 } | 157 } |
160 // Required for some compilers. | 158 // Required for some compilers. |
161 NOTREACHED(); | 159 NOTREACHED(); |
162 return nullptr; | 160 return nullptr; |
163 } | 161 } |
164 | 162 |
165 } // namespace ash | 163 } // namespace ash |
OLD | NEW |