| 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 "chrome/browser/ui/views/tabs/stacked_tab_strip_layout.h" | 5 #include "chrome/browser/ui/views/tabs/stacked_tab_strip_layout.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 | 11 |
| 12 StackedTabStripLayout::StackedTabStripLayout(const gfx::Size& size, | 12 StackedTabStripLayout::StackedTabStripLayout(const gfx::Size& size, |
| 13 int padding, | 13 int padding, |
| 14 int stacked_padding, | 14 int stacked_padding, |
| 15 int max_stacked_count, | 15 int max_stacked_count, |
| 16 views::ViewModel* view_model) | 16 views::ViewModelBase* view_model) |
| 17 : size_(size), | 17 : size_(size), |
| 18 padding_(padding), | 18 padding_(padding), |
| 19 stacked_padding_(stacked_padding), | 19 stacked_padding_(stacked_padding), |
| 20 max_stacked_count_(max_stacked_count), | 20 max_stacked_count_(max_stacked_count), |
| 21 view_model_(view_model), | 21 view_model_(view_model), |
| 22 x_(0), | 22 x_(0), |
| 23 width_(0), | 23 width_(0), |
| 24 mini_tab_count_(0), | 24 mini_tab_count_(0), |
| 25 mini_tab_to_non_mini_tab_(0), | 25 mini_tab_to_non_mini_tab_(0), |
| 26 active_index_(-1), | 26 active_index_(-1), |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 return width_ - trailing_offset - size_.width(); | 559 return width_ - trailing_offset - size_.width(); |
| 560 } | 560 } |
| 561 | 561 |
| 562 int StackedTabStripLayout::GetMinXCompressed(int index) const { | 562 int StackedTabStripLayout::GetMinXCompressed(int index) const { |
| 563 DCHECK_GT(index, active_index()); | 563 DCHECK_GT(index, active_index()); |
| 564 return std::max( | 564 return std::max( |
| 565 width_ - width_for_count(tab_count() - index), | 565 width_ - width_for_count(tab_count() - index), |
| 566 ideal_x(active_index()) + | 566 ideal_x(active_index()) + |
| 567 stacked_padding_for_count(index - active_index())); | 567 stacked_padding_for_count(index - active_index())); |
| 568 } | 568 } |
| OLD | NEW |