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 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/gfx/size.h" | 9 #include "ui/gfx/size.h" |
10 #include "ui/views/view_model.h" | 10 #include "ui/views/view_model.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // TouchTabStripLayout forces the active index to be in the normal tabs. | 74 // TouchTabStripLayout forces the active index to be in the normal tabs. |
75 int active_index() const { | 75 int active_index() const { |
76 return active_index_ < mini_tab_count_ ? mini_tab_count_ : active_index_; | 76 return active_index_ < mini_tab_count_ ? mini_tab_count_ : active_index_; |
77 } | 77 } |
78 | 78 |
79 int mini_tab_count() const { return mini_tab_count_; } | 79 int mini_tab_count() const { return mini_tab_count_; } |
80 | 80 |
81 // Returns true if the tab at index is stacked. | 81 // Returns true if the tab at index is stacked. |
82 bool IsStacked(int index) const; | 82 bool IsStacked(int index) const; |
83 | 83 |
| 84 // Sets the location of the active tab as close to |x| as possible. |
| 85 void SetActiveTabLocation(int x); |
| 86 |
84 #if !defined(NDEBUG) | 87 #if !defined(NDEBUG) |
85 std::string BoundsString() const; | 88 std::string BoundsString() const; |
86 #endif | 89 #endif |
87 | 90 |
88 private: | 91 private: |
89 friend class TouchTabStripLayoutTest; | 92 friend class TouchTabStripLayoutTest; |
90 | 93 |
91 // Sets the x-coordinate normal tabs start at, width mini-tab count and | 94 // Sets the x-coordinate normal tabs start at, width mini-tab count and |
92 // active index at once. | 95 // active index at once. |
93 void Reset(int x, int width, int mini_tab_count, int active_index); | 96 void Reset(int x, int width, int mini_tab_count, int active_index); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // Number of mini-tabs. | 215 // Number of mini-tabs. |
213 int mini_tab_count_; | 216 int mini_tab_count_; |
214 | 217 |
215 // Index of the active tab. | 218 // Index of the active tab. |
216 int active_index_; | 219 int active_index_; |
217 | 220 |
218 DISALLOW_COPY_AND_ASSIGN(TouchTabStripLayout); | 221 DISALLOW_COPY_AND_ASSIGN(TouchTabStripLayout); |
219 }; | 222 }; |
220 | 223 |
221 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TOUCH_TAB_STRIP_LAYOUT_H_ | 224 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TOUCH_TAB_STRIP_LAYOUT_H_ |
OLD | NEW |