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 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TOUCH_TAB_STRIP_LAYOUT_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TOUCH_TAB_STRIP_LAYOUT_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TABS_TOUCH_TAB_STRIP_LAYOUT_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TOUCH_TAB_STRIP_LAYOUT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 int start_x, | 70 int start_x, |
71 int mini_tab_count); | 71 int mini_tab_count); |
72 | 72 |
73 // Returns the active index as used by this class. The active index dictates | 73 // Returns the active index as used by this class. The active index dictates |
74 // stacking and what tabs are visible. As mini-tabs are never stacked, | 74 // stacking and what tabs are visible. As mini-tabs are never stacked, |
75 // TouchTabStripLayout forces the active index to be in the normal tabs. | 75 // TouchTabStripLayout forces the active index to be in the normal tabs. |
76 int active_index() const { | 76 int active_index() const { |
77 return active_index_ < mini_tab_count_ ? mini_tab_count_ : active_index_; | 77 return active_index_ < mini_tab_count_ ? mini_tab_count_ : active_index_; |
78 } | 78 } |
79 | 79 |
| 80 int mini_tab_count() const { return mini_tab_count_; } |
| 81 |
| 82 // Returns true if the tab at index is stacked. |
| 83 bool IsStacked(int index) const; |
| 84 |
80 private: | 85 private: |
81 friend class TouchTabStripLayoutTest; | 86 friend class TouchTabStripLayoutTest; |
82 | 87 |
83 // Sets the x-coordinate normal tabs start at, width mini-tab count and | 88 // Sets the x-coordinate normal tabs start at, width mini-tab count and |
84 // active index at once. | 89 // active index at once. |
85 void Reset(int x, int width, int mini_tab_count, int active_index); | 90 void Reset(int x, int width, int mini_tab_count, int active_index); |
86 | 91 |
87 // Resets to an ideal layout state. | 92 // Resets to an ideal layout state. |
88 void ResetToIdealState(); | 93 void ResetToIdealState(); |
89 | 94 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // Number of mini-tabs. | 210 // Number of mini-tabs. |
206 int mini_tab_count_; | 211 int mini_tab_count_; |
207 | 212 |
208 // Index of the active tab. | 213 // Index of the active tab. |
209 int active_index_; | 214 int active_index_; |
210 | 215 |
211 DISALLOW_COPY_AND_ASSIGN(TouchTabStripLayout); | 216 DISALLOW_COPY_AND_ASSIGN(TouchTabStripLayout); |
212 }; | 217 }; |
213 | 218 |
214 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TOUCH_TAB_STRIP_LAYOUT_H_ | 219 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TOUCH_TAB_STRIP_LAYOUT_H_ |
OLD | NEW |