OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 18 matching lines...) Expand all Loading... |
29 #include "content/common/notification_details.h" | 29 #include "content/common/notification_details.h" |
30 #include "content/common/notification_service.h" | 30 #include "content/common/notification_service.h" |
31 #include "content/common/notification_source.h" | 31 #include "content/common/notification_source.h" |
32 #include "grit/theme_resources.h" | 32 #include "grit/theme_resources.h" |
33 #include "grit/theme_resources_standard.h" | 33 #include "grit/theme_resources_standard.h" |
34 #include "grit/ui_resources.h" | 34 #include "grit/ui_resources.h" |
35 #include "third_party/skia/include/core/SkBitmap.h" | 35 #include "third_party/skia/include/core/SkBitmap.h" |
36 #include "third_party/skia/include/core/SkCanvas.h" | 36 #include "third_party/skia/include/core/SkCanvas.h" |
37 #include "third_party/skia/include/core/SkColor.h" | 37 #include "third_party/skia/include/core/SkColor.h" |
38 #include "third_party/skia/include/core/SkShader.h" | 38 #include "third_party/skia/include/core/SkShader.h" |
| 39 #include "ui/base/gtk/gtk_hig_constants.h" |
39 #include "ui/base/gtk/gtk_signal_registrar.h" | 40 #include "ui/base/gtk/gtk_signal_registrar.h" |
40 #include "ui/base/resource/resource_bundle.h" | 41 #include "ui/base/resource/resource_bundle.h" |
41 #include "ui/gfx/canvas_skia.h" | 42 #include "ui/gfx/canvas_skia.h" |
42 #include "ui/gfx/color_utils.h" | 43 #include "ui/gfx/color_utils.h" |
43 #include "ui/gfx/gtk_util.h" | 44 #include "ui/gfx/gtk_util.h" |
44 #include "ui/gfx/image/image.h" | 45 #include "ui/gfx/image/image.h" |
45 #include "ui/gfx/skbitmap_operations.h" | 46 #include "ui/gfx/skbitmap_operations.h" |
46 #include "ui/gfx/skia_util.h" | 47 #include "ui/gfx/skia_util.h" |
47 #include "ui/gfx/skia_utils_gtk.h" | 48 #include "ui/gfx/skia_utils_gtk.h" |
48 | 49 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 icon, state == GTK_STATE_NORMAL); | 232 icon, state == GTK_STATE_NORMAL); |
232 | 233 |
233 gtk_icon_set_add_source(icon_set, icon); | 234 gtk_icon_set_add_source(icon_set, icon); |
234 gtk_icon_source_free(icon); | 235 gtk_icon_source_free(icon); |
235 } | 236 } |
236 | 237 |
237 // Applies an HSL shift to a GdkColor (instead of an SkColor) | 238 // Applies an HSL shift to a GdkColor (instead of an SkColor) |
238 void GdkColorHSLShift(const color_utils::HSL& shift, GdkColor* frame_color) { | 239 void GdkColorHSLShift(const color_utils::HSL& shift, GdkColor* frame_color) { |
239 SkColor shifted = color_utils::HSLShift(GdkToSkColor(frame_color), shift); | 240 SkColor shifted = color_utils::HSLShift(GdkToSkColor(frame_color), shift); |
240 frame_color->pixel = 0; | 241 frame_color->pixel = 0; |
241 frame_color->red = SkColorGetR(shifted) * kSkiaToGDKMultiplier; | 242 frame_color->red = SkColorGetR(shifted) * ui::kSkiaToGDKMultiplier; |
242 frame_color->green = SkColorGetG(shifted) * kSkiaToGDKMultiplier; | 243 frame_color->green = SkColorGetG(shifted) * ui::kSkiaToGDKMultiplier; |
243 frame_color->blue = SkColorGetB(shifted) * kSkiaToGDKMultiplier; | 244 frame_color->blue = SkColorGetB(shifted) * ui::kSkiaToGDKMultiplier; |
244 } | 245 } |
245 | 246 |
246 } // namespace | 247 } // namespace |
247 | 248 |
248 GtkWidget* GtkThemeService::icon_widget_ = NULL; | 249 GtkWidget* GtkThemeService::icon_widget_ = NULL; |
249 GdkPixbuf* GtkThemeService::default_folder_icon_ = NULL; | 250 GdkPixbuf* GtkThemeService::default_folder_icon_ = NULL; |
250 GdkPixbuf* GtkThemeService::default_bookmark_icon_ = NULL; | 251 GdkPixbuf* GtkThemeService::default_bookmark_icon_ = NULL; |
251 | 252 |
252 // static | 253 // static |
253 GtkThemeService* GtkThemeService::GetFrom(Profile* profile) { | 254 GtkThemeService* GtkThemeService::GetFrom(Profile* profile) { |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 cairo_set_line_width(cr, 1.0); | 1197 cairo_set_line_width(cr, 1.0); |
1197 cairo_move_to(cr, start_x, widget->allocation.y); | 1198 cairo_move_to(cr, start_x, widget->allocation.y); |
1198 cairo_line_to(cr, start_x, | 1199 cairo_line_to(cr, start_x, |
1199 widget->allocation.y + widget->allocation.height); | 1200 widget->allocation.y + widget->allocation.height); |
1200 cairo_stroke(cr); | 1201 cairo_stroke(cr); |
1201 cairo_destroy(cr); | 1202 cairo_destroy(cr); |
1202 cairo_pattern_destroy(pattern); | 1203 cairo_pattern_destroy(pattern); |
1203 | 1204 |
1204 return TRUE; | 1205 return TRUE; |
1205 } | 1206 } |
OLD | NEW |