OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GTK_TABS_TAB_STRIP_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ |
6 #define CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ | 6 #define CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 // Initializes the new tab button. | 265 // Initializes the new tab button. |
266 CustomDrawButton* MakeNewTabButton(); | 266 CustomDrawButton* MakeNewTabButton(); |
267 | 267 |
268 // Gets the number of Tabs in the collection. | 268 // Gets the number of Tabs in the collection. |
269 int GetTabCount() const; | 269 int GetTabCount() const; |
270 | 270 |
271 // Returns the number of pinned tabs. | 271 // Returns the number of pinned tabs. |
272 int GetPinnedTabCount() const; | 272 int GetPinnedTabCount() const; |
273 | 273 |
274 // Retrieves the Tab at the specified index. | 274 // Retrieves the Tab at the specified index. Take care in using this, you may |
| 275 // need to use GetTabAtAdjustForAnimation. |
275 TabGtk* GetTabAt(int index) const; | 276 TabGtk* GetTabAt(int index) const; |
276 | 277 |
| 278 // Returns the tab at the specified index. If a remove animation is on going |
| 279 // and the index is >= the index of the tab being removed, the index is |
| 280 // incremented. While a remove operation is on going the indices of the model |
| 281 // do not line up with the indices of the view. This method adjusts the index |
| 282 // accordingly. |
| 283 // |
| 284 // Use this instead of GetTabAt if the index comes from the model. |
| 285 TabGtk* GetTabAtAdjustForAnimation(int index) const; |
| 286 |
277 // Returns the exact (unrounded) current width of each tab. | 287 // Returns the exact (unrounded) current width of each tab. |
278 void GetCurrentTabWidths(double* unselected_width, | 288 void GetCurrentTabWidths(double* unselected_width, |
279 double* selected_width) const; | 289 double* selected_width) const; |
280 | 290 |
281 // Returns the exact (unrounded) desired width of each tab, based on the | 291 // Returns the exact (unrounded) desired width of each tab, based on the |
282 // desired strip width and number of tabs. If | 292 // desired strip width and number of tabs. If |
283 // |width_of_tabs_for_mouse_close_| is nonnegative we use that value in | 293 // |width_of_tabs_for_mouse_close_| is nonnegative we use that value in |
284 // calculating the desired strip width; otherwise we use the current width. | 294 // calculating the desired strip width; otherwise we use the current width. |
285 // |pinned_tab_count| gives the number of pinned tabs, and |tab_count| the | 295 // |pinned_tab_count| gives the number of pinned tabs, and |tab_count| the |
286 // number of pinned and non-pinned tabs. | 296 // number of pinned and non-pinned tabs. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // ResizeLayoutTabsNow method. | 446 // ResizeLayoutTabsNow method. |
437 ScopedRunnableMethodFactory<TabStripGtk> resize_layout_factory_; | 447 ScopedRunnableMethodFactory<TabStripGtk> resize_layout_factory_; |
438 | 448 |
439 // True if the tabstrip has already been added as a MessageLoop observer. | 449 // True if the tabstrip has already been added as a MessageLoop observer. |
440 bool added_as_message_loop_observer_; | 450 bool added_as_message_loop_observer_; |
441 | 451 |
442 DISALLOW_COPY_AND_ASSIGN(TabStripGtk); | 452 DISALLOW_COPY_AND_ASSIGN(TabStripGtk); |
443 }; | 453 }; |
444 | 454 |
445 #endif // CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ | 455 #endif // CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ |
OLD | NEW |