| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/view_model_utils.h" | 5 #include "ui/views/view_model_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/views/view.h" |
| 9 #include "ui/views/view_model.h" | 10 #include "ui/views/view_model.h" |
| 10 #include "ui/views/view.h" | |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // Used in calculating ideal bounds. | 16 // Used in calculating ideal bounds. |
| 17 int primary_axis_coordinate(ViewModelUtils::Alignment alignment, | 17 int primary_axis_coordinate(ViewModelUtils::Alignment alignment, |
| 18 int x, | 18 int x, |
| 19 int y) { | 19 int y) { |
| 20 return alignment == ViewModelUtils::HORIZONTAL ? x : y; | 20 return alignment == ViewModelUtils::HORIZONTAL ? x : y; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 alignment, | 73 alignment, |
| 74 bounds.x() + bounds.width() / 2 - delta, | 74 bounds.x() + bounds.width() / 2 - delta, |
| 75 bounds.y() + bounds.height() / 2 - delta); | 75 bounds.y() + bounds.height() / 2 - delta); |
| 76 if (value < mid_point) | 76 if (value < mid_point) |
| 77 return i - 1; | 77 return i - 1; |
| 78 } | 78 } |
| 79 return model.view_size() - 1; | 79 return model.view_size() - 1; |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace views | 82 } // namespace views |
| OLD | NEW |