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_GTK_TABS_TAB_RENDERER_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 void PaintTab(GtkWidget* widget, GdkEventExpose* event); | 306 void PaintTab(GtkWidget* widget, GdkEventExpose* event); |
307 | 307 |
308 // Paint various portions of the Tab | 308 // Paint various portions of the Tab |
309 void PaintTitle(GtkWidget* widget, cairo_t* cr); | 309 void PaintTitle(GtkWidget* widget, cairo_t* cr); |
310 void PaintIcon(GtkWidget* widget, cairo_t* cr); | 310 void PaintIcon(GtkWidget* widget, cairo_t* cr); |
311 void PaintTabBackground(GtkWidget* widget, cairo_t* cr); | 311 void PaintTabBackground(GtkWidget* widget, cairo_t* cr); |
312 void PaintInactiveTabBackground(GtkWidget* widget, cairo_t* cr); | 312 void PaintInactiveTabBackground(GtkWidget* widget, cairo_t* cr); |
313 void PaintActiveTabBackground(GtkWidget* widget, cairo_t* cr); | 313 void PaintActiveTabBackground(GtkWidget* widget, cairo_t* cr); |
314 void PaintLoadingAnimation(GtkWidget* widget, cairo_t* cairo); | 314 void PaintLoadingAnimation(GtkWidget* widget, cairo_t* cairo); |
315 | 315 |
316 // Draws the given |tab_bg| onto |cr| using the tab shape masks along the | 316 // Sets the tab background image as the source pattern within |cr|. |bounds| |
317 // sides for the rounded tab shape. | 317 // are the bounds of the source pattern which will be used. |
318 void DrawTabBackground(cairo_t* cr, | 318 // The tab background source pattern is generated based on whether the tab |
319 GtkWidget* widget, | 319 // is active, whether the tab is in an incognito browser and on the current |
320 const gfx::Image& tab_bg, | 320 // theme. |
321 int offset_x, | 321 void SetTabBackgroundImageAsSource(cairo_t* cr, |
322 int offset_y); | 322 GtkWidget* widget, |
| 323 const gfx::Rect& bounds); |
| 324 |
| 325 // Draws the tab background image onto |cr| using the tab shape masks along |
| 326 // the sides for the rounded tab shape. |
| 327 void DrawTabBackground(cairo_t* cr, GtkWidget* widget); |
323 | 328 |
324 // Draws the tab shadow using the given idr resources onto |cr|. | 329 // Draws the tab shadow using the given idr resources onto |cr|. |
325 void DrawTabShadow(cairo_t* cr, | 330 void DrawTabShadow(cairo_t* cr, |
326 GtkWidget* widget, | 331 GtkWidget* widget, |
327 int left_idr, | 332 int left_idr, |
328 int center_idr, | 333 int center_idr, |
329 int right_idr); | 334 int right_idr); |
330 | 335 |
331 // Returns the number of favicon-size elements that can fit in the tab's | 336 // Returns the number of favicon-size elements that can fit in the tab's |
332 // current size. | 337 // current size. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 // Color of the title text on the selected tab. | 446 // Color of the title text on the selected tab. |
442 SkColor selected_title_color_; | 447 SkColor selected_title_color_; |
443 | 448 |
444 // Color of the title text on an unselected tab. | 449 // Color of the title text on an unselected tab. |
445 SkColor unselected_title_color_; | 450 SkColor unselected_title_color_; |
446 | 451 |
447 DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); | 452 DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); |
448 }; | 453 }; |
449 | 454 |
450 #endif // CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ | 455 #endif // CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ |
OLD | NEW |