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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // this tab. Only used for collecting UMA metrics. | 92 // this tab. Only used for collecting UMA metrics. |
93 // See ash/touch/touch_uma.cc. | 93 // See ash/touch/touch_uma.cc. |
94 bool tab_activated_with_last_gesture_begin() const { | 94 bool tab_activated_with_last_gesture_begin() const { |
95 return tab_activated_with_last_gesture_begin_; | 95 return tab_activated_with_last_gesture_begin_; |
96 } | 96 } |
97 | 97 |
98 views::GlowHoverController* hover_controller() { | 98 views::GlowHoverController* hover_controller() { |
99 return &hover_controller_; | 99 return &hover_controller_; |
100 } | 100 } |
101 | 101 |
| 102 // Returns the inset within the first dragged tab to use when calculating the |
| 103 // "drag insertion point". If we simply used the x-coordinate of the tab, |
| 104 // we'd be calculating based on a point well before where the user considers |
| 105 // the tab to "be". The value here is chosen to "feel good" based on the |
| 106 // widths of the tab images and the tab overlap. |
| 107 // |
| 108 // Note that this must return a value smaller than the midpoint of any tab's |
| 109 // width, or else the user won't be able to drag a tab to the left of the |
| 110 // first tab in the strip. |
| 111 static int leading_width_for_drag() { return 16; } |
| 112 |
102 // Returns the minimum possible size of a single unselected Tab. | 113 // Returns the minimum possible size of a single unselected Tab. |
103 static gfx::Size GetMinimumUnselectedSize(); | 114 static gfx::Size GetMinimumUnselectedSize(); |
104 // Returns the minimum possible size of a selected Tab. Selected tabs must | 115 // Returns the minimum possible size of a selected Tab. Selected tabs must |
105 // always show a close button and have a larger minimum size than unselected | 116 // always show a close button and have a larger minimum size than unselected |
106 // tabs. | 117 // tabs. |
107 static gfx::Size GetMinimumSelectedSize(); | 118 static gfx::Size GetMinimumSelectedSize(); |
108 // Returns the preferred size of a single Tab, assuming space is | 119 // Returns the preferred size of a single Tab, assuming space is |
109 // available. | 120 // available. |
110 static gfx::Size GetStandardSize(); | 121 static gfx::Size GetStandardSize(); |
111 | 122 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 SkColor close_button_color_; | 372 SkColor close_button_color_; |
362 | 373 |
363 // As the majority of the tabs are inactive, and painting tabs is slowish, | 374 // As the majority of the tabs are inactive, and painting tabs is slowish, |
364 // we cache a handful of the inactive tab backgrounds here. | 375 // we cache a handful of the inactive tab backgrounds here. |
365 static ImageCache* image_cache_; | 376 static ImageCache* image_cache_; |
366 | 377 |
367 DISALLOW_COPY_AND_ASSIGN(Tab); | 378 DISALLOW_COPY_AND_ASSIGN(Tab); |
368 }; | 379 }; |
369 | 380 |
370 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 381 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
OLD | NEW |