| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if (details.is_add) { | 119 if (details.is_add) { |
| 120 DCHECK(false) | 120 DCHECK(false) |
| 121 << "Child views should not be added directly. They should be added " | 121 << "Child views should not be added directly. They should be added " |
| 122 "using TriView::AddView()."; | 122 "using TriView::AddView()."; |
| 123 } else { | 123 } else { |
| 124 DCHECK(false) << "Container views should not be removed."; | 124 DCHECK(false) << "Container views should not be removed."; |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 const char* TriView::GetClassName() const { |
| 130 return "TriView"; |
| 131 } |
| 132 |
| 129 views::View* TriView::GetContainer(Container container) { | 133 views::View* TriView::GetContainer(Container container) { |
| 130 return child_at(static_cast<int>(container)); | 134 return child_at(static_cast<int>(container)); |
| 131 } | 135 } |
| 132 | 136 |
| 133 SizeRangeLayout* TriView::GetLayoutManager(Container container) { | 137 SizeRangeLayout* TriView::GetLayoutManager(Container container) { |
| 134 switch (container) { | 138 switch (container) { |
| 135 case Container::START: | 139 case Container::START: |
| 136 return start_container_layout_manager_; | 140 return start_container_layout_manager_; |
| 137 case Container::CENTER: | 141 case Container::CENTER: |
| 138 return center_container_layout_manager_; | 142 return center_container_layout_manager_; |
| 139 case Container::END: | 143 case Container::END: |
| 140 return end_container_layout_manager_; | 144 return end_container_layout_manager_; |
| 141 } | 145 } |
| 142 // Required for some compilers. | 146 // Required for some compilers. |
| 143 NOTREACHED(); | 147 NOTREACHED(); |
| 144 return nullptr; | 148 return nullptr; |
| 145 } | 149 } |
| 146 | 150 |
| 147 } // namespace ash | 151 } // namespace ash |
| OLD | NEW |