| 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_STACKED_TAB_STRIP_LAYOUT_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_STACKED_TAB_STRIP_LAYOUT_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TABS_STACKED_TAB_STRIP_LAYOUT_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_STACKED_TAB_STRIP_LAYOUT_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 private: | 96 private: |
| 97 friend class StackedTabStripLayoutTest; | 97 friend class StackedTabStripLayoutTest; |
| 98 | 98 |
| 99 // Sets the x-coordinate normal tabs start at, width pinned tab count and | 99 // Sets the x-coordinate normal tabs start at, width pinned tab count and |
| 100 // active index at once. | 100 // active index at once. |
| 101 void Reset(int x, int width, int pinned_tab_count, int active_index); | 101 void Reset(int x, int width, int pinned_tab_count, int active_index); |
| 102 | 102 |
| 103 // Resets to an ideal layout state. | 103 // Resets to an ideal layout state. |
| 104 void ResetToIdealState(); | 104 void ResetToIdealState(); |
| 105 | 105 |
| 106 // Makes |index| visible. This is used when a new tab is added that isn't | 106 // Makes all tabs between the active tab and |index| (inclusive) visible. If |
| 107 // active. | 107 // this is not possible, then |index| is made visible and a stack forms |
| 108 // immediately to the right of the active tab. This is used when a new tab is |
| 109 // added that isn't active. |
| 108 void MakeVisible(int index); | 110 void MakeVisible(int index); |
| 109 | 111 |
| 110 // Returns the x-coordinate for the active tab constrained by the current tab | 112 // Returns the x-coordinate for the active tab constrained by the current tab |
| 111 // counts. | 113 // counts. |
| 112 int ConstrainActiveX(int x) const; | 114 int ConstrainActiveX(int x) const; |
| 113 | 115 |
| 114 // Reset the bounds of the active tab (based on ConstrainActiveX()) and resets | 116 // Reset the bounds of the active tab (based on ConstrainActiveX()) and resets |
| 115 // the bounds of the remaining tabs by way of LayoutUsingCurrent*. | 117 // the bounds of the remaining tabs by way of LayoutUsingCurrent*. |
| 116 void SetActiveBoundsAndLayoutFromActiveTab(); | 118 void SetActiveBoundsAndLayoutFromActiveTab(); |
| 117 | 119 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 int active_index_; | 238 int active_index_; |
| 237 | 239 |
| 238 // X-coordinate of the first tab. This is either |x_| if there are no | 240 // X-coordinate of the first tab. This is either |x_| if there are no |
| 239 // pinned tabs, or the x-coordinate of the first pinned tab. | 241 // pinned tabs, or the x-coordinate of the first pinned tab. |
| 240 int first_tab_x_; | 242 int first_tab_x_; |
| 241 | 243 |
| 242 DISALLOW_COPY_AND_ASSIGN(StackedTabStripLayout); | 244 DISALLOW_COPY_AND_ASSIGN(StackedTabStripLayout); |
| 243 }; | 245 }; |
| 244 | 246 |
| 245 #endif // CHROME_BROWSER_UI_VIEWS_TABS_STACKED_TAB_STRIP_LAYOUT_H_ | 247 #endif // CHROME_BROWSER_UI_VIEWS_TABS_STACKED_TAB_STRIP_LAYOUT_H_ |
| OLD | NEW |