| 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_TAB_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 | 120 |
| 121 views::GlowHoverController* hover_controller() { | 121 views::GlowHoverController* hover_controller() { |
| 122 return &hover_controller_; | 122 return &hover_controller_; |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Returns the width of the largest part of the tab that is available for the | 125 // Returns the width of the largest part of the tab that is available for the |
| 126 // user to click to select/activate the tab. | 126 // user to click to select/activate the tab. |
| 127 int GetWidthOfLargestSelectableRegion() const; | 127 int GetWidthOfLargestSelectableRegion() const; |
| 128 | 128 |
| 129 // Called when stacked layout changes and the close button may need to |
| 130 // be updated. |
| 131 void HideCloseButtonForInactiveTabsChanged() { Layout(); } |
| 132 |
| 129 // Returns the inset within the first dragged tab to use when calculating the | 133 // Returns the inset within the first dragged tab to use when calculating the |
| 130 // "drag insertion point". If we simply used the x-coordinate of the tab, | 134 // "drag insertion point". If we simply used the x-coordinate of the tab, |
| 131 // we'd be calculating based on a point well before where the user considers | 135 // we'd be calculating based on a point well before where the user considers |
| 132 // the tab to "be". The value here is chosen to "feel good" based on the | 136 // the tab to "be". The value here is chosen to "feel good" based on the |
| 133 // widths of the tab images and the tab overlap. | 137 // widths of the tab images and the tab overlap. |
| 134 // | 138 // |
| 135 // Note that this must return a value smaller than the midpoint of any tab's | 139 // Note that this must return a value smaller than the midpoint of any tab's |
| 136 // width, or else the user won't be able to drag a tab to the left of the | 140 // width, or else the user won't be able to drag a tab to the left of the |
| 137 // first tab in the strip. | 141 // first tab in the strip. |
| 138 static int leading_width_for_drag() { return 16; } | 142 static int leading_width_for_drag() { return 16; } |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 SkColor button_color_; | 420 SkColor button_color_; |
| 417 | 421 |
| 418 // As the majority of the tabs are inactive, and painting tabs is slowish, | 422 // As the majority of the tabs are inactive, and painting tabs is slowish, |
| 419 // we cache a handful of the inactive tab backgrounds here. | 423 // we cache a handful of the inactive tab backgrounds here. |
| 420 static ImageCache* image_cache_; | 424 static ImageCache* image_cache_; |
| 421 | 425 |
| 422 DISALLOW_COPY_AND_ASSIGN(Tab); | 426 DISALLOW_COPY_AND_ASSIGN(Tab); |
| 423 }; | 427 }; |
| 424 | 428 |
| 425 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 429 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
| OLD | NEW |