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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 void PaintTab(gfx::Canvas* canvas); | 207 void PaintTab(gfx::Canvas* canvas); |
208 | 208 |
209 // Paint with the "immersive mode" light-bar style. | 209 // Paint with the "immersive mode" light-bar style. |
210 void PaintImmersiveTab(gfx::Canvas* canvas); | 210 void PaintImmersiveTab(gfx::Canvas* canvas); |
211 | 211 |
212 // Paint various portions of the Tab | 212 // Paint various portions of the Tab |
213 void PaintTabBackground(gfx::Canvas* canvas); | 213 void PaintTabBackground(gfx::Canvas* canvas); |
214 void PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas, | 214 void PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas, |
215 ui::MultiAnimation* animation); | 215 ui::MultiAnimation* animation); |
216 void PaintInactiveTabBackground(gfx::Canvas* canvas); | 216 void PaintInactiveTabBackground(gfx::Canvas* canvas); |
217 void PaintInactiveTabBackgroundUsingResourceId(gfx::Canvas* canvas, | 217 void PaintInactiveTabBackgroundUsingResourceIds(gfx::Canvas* canvas, |
218 int tab_id); | 218 int background_id, |
| 219 int background_overlay_id); |
219 void PaintActiveTabBackground(gfx::Canvas* canvas); | 220 void PaintActiveTabBackground(gfx::Canvas* canvas); |
220 | 221 |
221 // Paints the icon at the specified coordinates, mirrored for RTL if needed. | 222 // Paints the icon at the specified coordinates, mirrored for RTL if needed. |
222 void PaintIcon(gfx::Canvas* canvas); | 223 void PaintIcon(gfx::Canvas* canvas); |
223 void PaintCaptureState(gfx::Canvas* canvas, gfx::Rect bounds); | 224 void PaintCaptureState(gfx::Canvas* canvas, gfx::Rect bounds); |
224 void PaintTitle(gfx::Canvas* canvas, SkColor title_color); | 225 void PaintTitle(gfx::Canvas* canvas, SkColor title_color); |
225 | 226 |
226 // Invoked if data_.network_state changes, or the network_state is not none. | 227 // Invoked if data_.network_state changes, or the network_state is not none. |
227 void AdvanceLoadingAnimation(TabRendererData::NetworkState old_state, | 228 void AdvanceLoadingAnimation(TabRendererData::NetworkState old_state, |
228 TabRendererData::NetworkState state); | 229 TabRendererData::NetworkState state); |
(...skipping 26 matching lines...) Expand all Loading... |
255 | 256 |
256 // Returns true if the crash animation is currently running. | 257 // Returns true if the crash animation is currently running. |
257 bool IsPerformingCrashAnimation() const; | 258 bool IsPerformingCrashAnimation() const; |
258 | 259 |
259 // Schedules repaint task for icon. | 260 // Schedules repaint task for icon. |
260 void ScheduleIconPaint(); | 261 void ScheduleIconPaint(); |
261 | 262 |
262 // Returns the rectangle for the light bar in immersive mode. | 263 // Returns the rectangle for the light bar in immersive mode. |
263 gfx::Rect GetImmersiveBarRect() const; | 264 gfx::Rect GetImmersiveBarRect() const; |
264 | 265 |
265 // Gets the tab id and frame id. | 266 // Gets the resource ids of the theme images to use for painting the inactive |
266 void GetTabIdAndFrameId(views::Widget* widget, | 267 // tab background. |
267 int* tab_id, | 268 void GetInactiveBackgroundIdAndOverlayId(views::Widget* widget, |
268 int* frame_id) const; | 269 int* background_id, |
| 270 int* background_overlay_id) const; |
269 | 271 |
270 // Performs a one-time initialization of static resources such as tab images. | 272 // Performs a one-time initialization of static resources such as tab images. |
271 static void InitTabResources(); | 273 static void InitTabResources(); |
272 | 274 |
273 // Returns the minimum possible size of a single unselected Tab, not | 275 // Returns the minimum possible size of a single unselected Tab, not |
274 // including considering touch mode. | 276 // including considering touch mode. |
275 static gfx::Size GetBasicMinimumUnselectedSize(); | 277 static gfx::Size GetBasicMinimumUnselectedSize(); |
276 | 278 |
277 // Loads the images to be used for the tab background. | 279 // Loads the images to be used for the tab background. |
278 static void LoadTabImages(); | 280 static void LoadTabImages(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 static int font_height_; | 367 static int font_height_; |
366 | 368 |
367 // As the majority of the tabs are inactive, and painting tabs is slowish, | 369 // As the majority of the tabs are inactive, and painting tabs is slowish, |
368 // we cache a handful of the inactive tab backgrounds here. | 370 // we cache a handful of the inactive tab backgrounds here. |
369 static ImageCache* image_cache_; | 371 static ImageCache* image_cache_; |
370 | 372 |
371 DISALLOW_COPY_AND_ASSIGN(Tab); | 373 DISALLOW_COPY_AND_ASSIGN(Tab); |
372 }; | 374 }; |
373 | 375 |
374 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 376 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
OLD | NEW |