| 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" | |
| 40 #include "ui/base/gtk/gtk_signal_registrar.h" | 39 #include "ui/base/gtk/gtk_signal_registrar.h" |
| 41 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
| 42 #include "ui/gfx/canvas_skia.h" | 41 #include "ui/gfx/canvas_skia.h" |
| 43 #include "ui/gfx/color_utils.h" | 42 #include "ui/gfx/color_utils.h" |
| 44 #include "ui/gfx/gtk_util.h" | 43 #include "ui/gfx/gtk_util.h" |
| 45 #include "ui/gfx/image/image.h" | 44 #include "ui/gfx/image/image.h" |
| 46 #include "ui/gfx/skbitmap_operations.h" | 45 #include "ui/gfx/skbitmap_operations.h" |
| 47 #include "ui/gfx/skia_util.h" | 46 #include "ui/gfx/skia_util.h" |
| 48 #include "ui/gfx/skia_utils_gtk.h" | 47 #include "ui/gfx/skia_utils_gtk.h" |
| 49 | 48 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 icon, state == GTK_STATE_NORMAL); | 231 icon, state == GTK_STATE_NORMAL); |
| 233 | 232 |
| 234 gtk_icon_set_add_source(icon_set, icon); | 233 gtk_icon_set_add_source(icon_set, icon); |
| 235 gtk_icon_source_free(icon); | 234 gtk_icon_source_free(icon); |
| 236 } | 235 } |
| 237 | 236 |
| 238 // Applies an HSL shift to a GdkColor (instead of an SkColor) | 237 // Applies an HSL shift to a GdkColor (instead of an SkColor) |
| 239 void GdkColorHSLShift(const color_utils::HSL& shift, GdkColor* frame_color) { | 238 void GdkColorHSLShift(const color_utils::HSL& shift, GdkColor* frame_color) { |
| 240 SkColor shifted = color_utils::HSLShift(GdkToSkColor(frame_color), shift); | 239 SkColor shifted = color_utils::HSLShift(GdkToSkColor(frame_color), shift); |
| 241 frame_color->pixel = 0; | 240 frame_color->pixel = 0; |
| 242 frame_color->red = SkColorGetR(shifted) * ui::kSkiaToGDKMultiplier; | 241 frame_color->red = SkColorGetR(shifted) * kSkiaToGDKMultiplier; |
| 243 frame_color->green = SkColorGetG(shifted) * ui::kSkiaToGDKMultiplier; | 242 frame_color->green = SkColorGetG(shifted) * kSkiaToGDKMultiplier; |
| 244 frame_color->blue = SkColorGetB(shifted) * ui::kSkiaToGDKMultiplier; | 243 frame_color->blue = SkColorGetB(shifted) * kSkiaToGDKMultiplier; |
| 245 } | 244 } |
| 246 | 245 |
| 247 } // namespace | 246 } // namespace |
| 248 | 247 |
| 249 GtkWidget* GtkThemeService::icon_widget_ = NULL; | 248 GtkWidget* GtkThemeService::icon_widget_ = NULL; |
| 250 GdkPixbuf* GtkThemeService::default_folder_icon_ = NULL; | 249 GdkPixbuf* GtkThemeService::default_folder_icon_ = NULL; |
| 251 GdkPixbuf* GtkThemeService::default_bookmark_icon_ = NULL; | 250 GdkPixbuf* GtkThemeService::default_bookmark_icon_ = NULL; |
| 252 | 251 |
| 253 // static | 252 // static |
| 254 GtkThemeService* GtkThemeService::GetFrom(Profile* profile) { | 253 GtkThemeService* GtkThemeService::GetFrom(Profile* profile) { |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 cairo_set_line_width(cr, 1.0); | 1195 cairo_set_line_width(cr, 1.0); |
| 1197 cairo_move_to(cr, start_x, widget->allocation.y); | 1196 cairo_move_to(cr, start_x, widget->allocation.y); |
| 1198 cairo_line_to(cr, start_x, | 1197 cairo_line_to(cr, start_x, |
| 1199 widget->allocation.y + widget->allocation.height); | 1198 widget->allocation.y + widget->allocation.height); |
| 1200 cairo_stroke(cr); | 1199 cairo_stroke(cr); |
| 1201 cairo_destroy(cr); | 1200 cairo_destroy(cr); |
| 1202 cairo_pattern_destroy(pattern); | 1201 cairo_pattern_destroy(pattern); |
| 1203 | 1202 |
| 1204 return TRUE; | 1203 return TRUE; |
| 1205 } | 1204 } |
| OLD | NEW |