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 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 5 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 int color_id, | 1033 int color_id, |
1034 const char* gradient_name) const { | 1034 const char* gradient_name) const { |
1035 // We use two colors: the main color (passed in) and a lightened version of | 1035 // We use two colors: the main color (passed in) and a lightened version of |
1036 // that color (which is supposed to match the light gradient at the top of | 1036 // that color (which is supposed to match the light gradient at the top of |
1037 // several GTK+ themes, such as Ambiance, Clearlooks or Bluebird). | 1037 // several GTK+ themes, such as Ambiance, Clearlooks or Bluebird). |
1038 ColorMap::const_iterator it = colors_.find(color_id); | 1038 ColorMap::const_iterator it = colors_.find(color_id); |
1039 DCHECK(it != colors_.end()); | 1039 DCHECK(it != colors_.end()); |
1040 SkColor base = it->second; | 1040 SkColor base = it->second; |
1041 | 1041 |
1042 gfx::Canvas canvas(gfx::Size(kToolbarImageWidth, kToolbarImageHeight), | 1042 gfx::Canvas canvas(gfx::Size(kToolbarImageWidth, kToolbarImageHeight), |
1043 ui::SCALE_FACTOR_100P, true); | 1043 1.0f, true); |
1044 | 1044 |
1045 int gradient_size; | 1045 int gradient_size; |
1046 GdkColor* gradient_top_color = NULL; | 1046 GdkColor* gradient_top_color = NULL; |
1047 gtk_widget_style_get(GTK_WIDGET(fake_frame_), | 1047 gtk_widget_style_get(GTK_WIDGET(fake_frame_), |
1048 "frame-gradient-size", &gradient_size, | 1048 "frame-gradient-size", &gradient_size, |
1049 gradient_name, &gradient_top_color, | 1049 gradient_name, &gradient_top_color, |
1050 NULL); | 1050 NULL); |
1051 if (gradient_size) { | 1051 if (gradient_size) { |
1052 SkColor lighter = gradient_top_color ? | 1052 SkColor lighter = gradient_top_color ? |
1053 gfx::GdkColorToSkColor(*gradient_top_color) : | 1053 gfx::GdkColorToSkColor(*gradient_top_color) : |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 cairo_stroke(cr); | 1181 cairo_stroke(cr); |
1182 cairo_destroy(cr); | 1182 cairo_destroy(cr); |
1183 cairo_pattern_destroy(pattern); | 1183 cairo_pattern_destroy(pattern); |
1184 | 1184 |
1185 return TRUE; | 1185 return TRUE; |
1186 } | 1186 } |
1187 | 1187 |
1188 void GtkThemeService::OnUsesSystemThemeChanged() { | 1188 void GtkThemeService::OnUsesSystemThemeChanged() { |
1189 use_gtk_ = profile()->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme); | 1189 use_gtk_ = profile()->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme); |
1190 } | 1190 } |
OLD | NEW |