OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/ui/views/tabs/tab_strip_layout.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip_layout.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 | 10 |
9 #include "base/logging.h" | 11 #include "base/logging.h" |
10 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
11 | 13 |
12 namespace { | 14 namespace { |
13 | 15 |
14 // Calculates the size for normal tabs. | 16 // Calculates the size for normal tabs. |
15 // |is_active_tab_normal| is true if the active tab is a normal tab, if false | 17 // |is_active_tab_normal| is true if the active tab is a normal tab, if false |
16 // the active tab is not in the set of normal tabs. | 18 // the active tab is not in the set of normal tabs. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if (expand_width_count > 0 && (!is_active || give_extra_space_to_active)) { | 124 if (expand_width_count > 0 && (!is_active || give_extra_space_to_active)) { |
123 ++width; | 125 ++width; |
124 --expand_width_count; | 126 --expand_width_count; |
125 } | 127 } |
126 tabs_bounds[i].SetRect(next_x, 0, width, tab_size_info.max_size.height()); | 128 tabs_bounds[i].SetRect(next_x, 0, width, tab_size_info.max_size.height()); |
127 next_x += tabs_bounds[i].width() - tab_size_info.tab_overlap; | 129 next_x += tabs_bounds[i].width() - tab_size_info.tab_overlap; |
128 } | 130 } |
129 | 131 |
130 return tabs_bounds; | 132 return tabs_bounds; |
131 } | 133 } |
OLD | NEW |