Chromium Code Reviews| Index: chrome/browser/ui/gtk/theme_service_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/theme_service_gtk.cc b/chrome/browser/ui/gtk/theme_service_gtk.cc |
| index 7c50f6e888fc95ca30898d03d4b87433edf5ff1a..be54aa93671795ab1843dc068e94282938b80e2e 100644 |
| --- a/chrome/browser/ui/gtk/theme_service_gtk.cc |
| +++ b/chrome/browser/ui/gtk/theme_service_gtk.cc |
| @@ -778,6 +778,9 @@ void ThemeServiceGtk::LoadGtkValues() { |
| SetThemeColorFromGtk(ThemeService::COLOR_NTP_SECTION_LINK_UNDERLINE, |
| link_color); |
| + if (!gdk_color_equal(link_color, &kDefaultLinkColor)) |
|
John Knottenbelt
2012/03/27 14:45:47
We need to compare address, rather than value.
Al
tfarina
2012/03/27 15:29:06
Done.
|
| + gdk_color_free(const_cast<GdkColor*>(link_color)); |
| + |
| // Generate the colors that we pass to WebKit. |
| focus_ring_color_ = gfx::GdkColorToSkColor(frame_color); |
| GdkColor thumb_active_color, thumb_inactive_color, track_color; |
| @@ -801,10 +804,10 @@ void ThemeServiceGtk::LoadGtkValues() { |
| } |
| GdkColor ThemeServiceGtk::BuildFrameColors(GtkStyle* frame_style) { |
| - const GdkColor* theme_frame = NULL; |
| - const GdkColor* theme_inactive_frame = NULL; |
| - const GdkColor* theme_incognito_frame = NULL; |
| - const GdkColor* theme_incognito_inactive_frame = NULL; |
| + GdkColor* theme_frame = NULL; |
| + GdkColor* theme_inactive_frame = NULL; |
| + GdkColor* theme_incognito_frame = NULL; |
| + GdkColor* theme_incognito_inactive_frame = NULL; |
| gtk_widget_style_get(GTK_WIDGET(fake_frame_), |
| "frame-color", &theme_frame, |
| "inactive-frame-color", &theme_inactive_frame, |
| @@ -819,6 +822,7 @@ GdkColor ThemeServiceGtk::BuildFrameColors(GtkStyle* frame_style) { |
| kDefaultFrameShift, |
| ThemeService::COLOR_FRAME, |
| ThemeService::TINT_FRAME); |
| + gdk_color_free(theme_frame); |
|
John Knottenbelt
2012/03/27 14:45:47
We need to check for NULL here and in the other ca
tfarina
2012/03/27 15:29:06
Done.
|
| SetThemeTintFromGtk(ThemeService::TINT_BACKGROUND_TAB, &frame_color); |
| BuildAndSetFrameColor( |
| @@ -827,6 +831,7 @@ GdkColor ThemeServiceGtk::BuildFrameColors(GtkStyle* frame_style) { |
| kDefaultFrameShift, |
| ThemeService::COLOR_FRAME_INACTIVE, |
| ThemeService::TINT_FRAME_INACTIVE); |
| + gdk_color_free(theme_inactive_frame); |
| BuildAndSetFrameColor( |
| &frame_color, |
| @@ -834,6 +839,7 @@ GdkColor ThemeServiceGtk::BuildFrameColors(GtkStyle* frame_style) { |
| GetDefaultTint(ThemeService::TINT_FRAME_INCOGNITO), |
| ThemeService::COLOR_FRAME_INCOGNITO, |
| ThemeService::TINT_FRAME_INCOGNITO); |
| + gdk_color_free(theme_incognito_frame); |
| BuildAndSetFrameColor( |
| &frame_color, |
| @@ -841,6 +847,7 @@ GdkColor ThemeServiceGtk::BuildFrameColors(GtkStyle* frame_style) { |
| GetDefaultTint(ThemeService::TINT_FRAME_INCOGNITO_INACTIVE), |
| ThemeService::COLOR_FRAME_INCOGNITO_INACTIVE, |
| ThemeService::TINT_FRAME_INCOGNITO_INACTIVE); |
| + gdk_color_free(theme_incognito_inactive_frame); |
| return frame_color; |
| } |
| @@ -993,7 +1000,7 @@ SkBitmap* ThemeServiceGtk::GenerateFrameImage( |
| gfx::Canvas canvas(gfx::Size(kToolbarImageWidth, kToolbarImageHeight), true); |
| int gradient_size; |
| - const GdkColor* gradient_top_color = NULL; |
| + GdkColor* gradient_top_color = NULL; |
| gtk_widget_style_get(GTK_WIDGET(fake_frame_), |
| "frame-gradient-size", &gradient_size, |
| gradient_name, &gradient_top_color, |
| @@ -1002,6 +1009,7 @@ SkBitmap* ThemeServiceGtk::GenerateFrameImage( |
| SkColor lighter = gradient_top_color ? |
| gfx::GdkColorToSkColor(*gradient_top_color) : |
| color_utils::HSLShift(base, kGtkFrameShift); |
| + gdk_color_free(gradient_top_color); |
| SkShader* shader = gfx::CreateGradientShader( |
| 0, gradient_size, lighter, base); |
| SkPaint paint; |