| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 GdkPixbuf* GtkThemeService::default_bookmark_icon_ = NULL; | 249 GdkPixbuf* GtkThemeService::default_bookmark_icon_ = NULL; |
| 250 | 250 |
| 251 // static | 251 // static |
| 252 GtkThemeService* GtkThemeService::GetFrom(Profile* profile) { | 252 GtkThemeService* GtkThemeService::GetFrom(Profile* profile) { |
| 253 return static_cast<GtkThemeService*>( | 253 return static_cast<GtkThemeService*>( |
| 254 ThemeServiceFactory::GetForProfile(profile)); | 254 ThemeServiceFactory::GetForProfile(profile)); |
| 255 } | 255 } |
| 256 | 256 |
| 257 GtkThemeService::GtkThemeService() | 257 GtkThemeService::GtkThemeService() |
| 258 : ThemeService(), | 258 : ThemeService(), |
| 259 use_gtk_(false), |
| 259 fake_window_(gtk_window_new(GTK_WINDOW_TOPLEVEL)), | 260 fake_window_(gtk_window_new(GTK_WINDOW_TOPLEVEL)), |
| 260 fake_frame_(chrome_gtk_frame_new()), | 261 fake_frame_(chrome_gtk_frame_new()), |
| 261 signals_(new ui::GtkSignalRegistrar), | 262 signals_(new ui::GtkSignalRegistrar), |
| 262 fullscreen_icon_set_(NULL) { | 263 fullscreen_icon_set_(NULL) { |
| 263 fake_label_.Own(gtk_label_new("")); | 264 fake_label_.Own(gtk_label_new("")); |
| 264 fake_entry_.Own(gtk_entry_new()); | 265 fake_entry_.Own(gtk_entry_new()); |
| 265 fake_menu_item_.Own(gtk_menu_item_new()); | 266 fake_menu_item_.Own(gtk_menu_item_new()); |
| 266 | 267 |
| 267 // Only realized widgets receive style-set notifications, which we need to | 268 // Only realized widgets receive style-set notifications, which we need to |
| 268 // broadcast new theme images and colors. Only realized widgets have style | 269 // broadcast new theme images and colors. Only realized widgets have style |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 cairo_set_line_width(cr, 1.0); | 1140 cairo_set_line_width(cr, 1.0); |
| 1140 cairo_move_to(cr, start_x, widget->allocation.y); | 1141 cairo_move_to(cr, start_x, widget->allocation.y); |
| 1141 cairo_line_to(cr, start_x, | 1142 cairo_line_to(cr, start_x, |
| 1142 widget->allocation.y + widget->allocation.height); | 1143 widget->allocation.y + widget->allocation.height); |
| 1143 cairo_stroke(cr); | 1144 cairo_stroke(cr); |
| 1144 cairo_destroy(cr); | 1145 cairo_destroy(cr); |
| 1145 cairo_pattern_destroy(pattern); | 1146 cairo_pattern_destroy(pattern); |
| 1146 | 1147 |
| 1147 return TRUE; | 1148 return TRUE; |
| 1148 } | 1149 } |
| OLD | NEW |