| OLD | NEW |
| 1 | 1 |
| 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 6 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 if (theme_thumb_active) | 556 if (theme_thumb_active) |
| 557 *thumb_active_color = *theme_thumb_active; | 557 *thumb_active_color = *theme_thumb_active; |
| 558 | 558 |
| 559 if (theme_thumb_inactive) | 559 if (theme_thumb_inactive) |
| 560 *thumb_inactive_color = *theme_thumb_inactive; | 560 *thumb_inactive_color = *theme_thumb_inactive; |
| 561 | 561 |
| 562 if (theme_trough_color) | 562 if (theme_trough_color) |
| 563 *track_color = *theme_trough_color; | 563 *track_color = *theme_trough_color; |
| 564 } | 564 } |
| 565 | 565 |
| 566 gfx::CairoCachedSurface* GtkThemeService::GetSurfaceNamed( | |
| 567 int id, | |
| 568 GtkWidget* widget_on_display) { | |
| 569 return GetSurfaceNamedImpl( | |
| 570 id, | |
| 571 &per_display_surfaces_, | |
| 572 &GtkThemeService::GetPixbufNamed, | |
| 573 widget_on_display); | |
| 574 } | |
| 575 | |
| 576 gfx::CairoCachedSurface* GtkThemeService::GetRTLEnabledSurfaceNamed( | 566 gfx::CairoCachedSurface* GtkThemeService::GetRTLEnabledSurfaceNamed( |
| 577 int id, | 567 int id, |
| 578 GtkWidget* widget_on_display) { | 568 GtkWidget* widget_on_display) { |
| 579 // We flip the sign of |id| when passing it to GetSurfaceNamedImpl() for the | 569 // We flip the sign of |id| when passing it to GetSurfaceNamedImpl() for the |
| 580 // same reason that ThemeService::GetPixbufImpl() does: so that if one | 570 // same reason that ThemeService::GetPixbufImpl() does: so that if one |
| 581 // location calls this function with a resource ID, and another place calls | 571 // location calls this function with a resource ID, and another place calls |
| 582 // GetSurfaceNamed() with the same ID, they'll correctly get different | 572 // GetSurfaceNamed() with the same ID, they'll correctly get different |
| 583 // surfaces in RTL mode. | 573 // surfaces in RTL mode. |
| 584 return GetSurfaceNamedImpl( | 574 return GetSurfaceNamedImpl( |
| 585 -id, | 575 -id, |
| 586 &per_display_surfaces_, | 576 &per_display_surfaces_, |
| 587 &GtkThemeService::GetRTLEnabledPixbufNamedWrapper, | 577 &GtkThemeService::GetRTLEnabledPixbufNamedWrapper, |
| 588 widget_on_display); | 578 widget_on_display); |
| 589 } | 579 } |
| 590 | 580 |
| 591 gfx::CairoCachedSurface* GtkThemeService::GetUnthemedSurfaceNamed( | |
| 592 int id, | |
| 593 GtkWidget* widget_on_display) { | |
| 594 return GetSurfaceNamedImpl(id, | |
| 595 &per_display_unthemed_surfaces_, | |
| 596 &GtkThemeService::GetUnthemedNativePixbuf, | |
| 597 widget_on_display); | |
| 598 } | |
| 599 | |
| 600 gfx::CairoCachedSurface* GtkThemeService::GetCairoIcon( | 581 gfx::CairoCachedSurface* GtkThemeService::GetCairoIcon( |
| 601 int id, | 582 int id, |
| 602 GtkWidget* widget_on_display) { | 583 GtkWidget* widget_on_display) { |
| 603 return GetSurfaceNamedImpl(id, | 584 return GetSurfaceNamedImpl(id, |
| 604 &per_display_icon_surfaces_, | 585 &per_display_icon_surfaces_, |
| 605 &GtkThemeService::GetPixbufForIconId, | 586 &GtkThemeService::GetPixbufForIconId, |
| 606 widget_on_display); | 587 widget_on_display); |
| 607 } | 588 } |
| 608 | 589 |
| 609 // static | 590 // static |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 cairo_new_path(cr); | 1220 cairo_new_path(cr); |
| 1240 cairo_set_line_width(cr, 1.0); | 1221 cairo_set_line_width(cr, 1.0); |
| 1241 cairo_move_to(cr, start_x, allocation.y); | 1222 cairo_move_to(cr, start_x, allocation.y); |
| 1242 cairo_line_to(cr, start_x, allocation.y + allocation.height); | 1223 cairo_line_to(cr, start_x, allocation.y + allocation.height); |
| 1243 cairo_stroke(cr); | 1224 cairo_stroke(cr); |
| 1244 cairo_destroy(cr); | 1225 cairo_destroy(cr); |
| 1245 cairo_pattern_destroy(pattern); | 1226 cairo_pattern_destroy(pattern); |
| 1246 | 1227 |
| 1247 return TRUE; | 1228 return TRUE; |
| 1248 } | 1229 } |
| OLD | NEW |