| OLD | NEW |
| 1 | 1 |
| 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 6 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/debug/trace_event.h" |
| 13 #include "base/environment.h" | 14 #include "base/environment.h" |
| 14 #include "base/nix/xdg_util.h" | 15 #include "base/nix/xdg_util.h" |
| 15 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 16 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/themes/theme_service_factory.h" | 19 #include "chrome/browser/themes/theme_service_factory.h" |
| 19 #include "chrome/browser/ui/browser_list.h" | 20 #include "chrome/browser/ui/browser_list.h" |
| 20 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
| 21 #include "chrome/browser/ui/gtk/chrome_gtk_frame.h" | 22 #include "chrome/browser/ui/gtk/chrome_gtk_frame.h" |
| 22 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" | 23 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 } | 1185 } |
| 1185 | 1186 |
| 1186 void GtkThemeService::OnDestroyLabel(GtkWidget* button) { | 1187 void GtkThemeService::OnDestroyLabel(GtkWidget* button) { |
| 1187 std::map<GtkWidget*, GdkColor>::iterator it = labels_.find(button); | 1188 std::map<GtkWidget*, GdkColor>::iterator it = labels_.find(button); |
| 1188 if (it != labels_.end()) | 1189 if (it != labels_.end()) |
| 1189 labels_.erase(it); | 1190 labels_.erase(it); |
| 1190 } | 1191 } |
| 1191 | 1192 |
| 1192 gboolean GtkThemeService::OnSeparatorExpose(GtkWidget* widget, | 1193 gboolean GtkThemeService::OnSeparatorExpose(GtkWidget* widget, |
| 1193 GdkEventExpose* event) { | 1194 GdkEventExpose* event) { |
| 1195 UNSHIPPED_TRACE_EVENT0("ui::gtk", "GtkThemeService::OnSeparatorExpose"); |
| 1194 if (UsingNativeTheme()) | 1196 if (UsingNativeTheme()) |
| 1195 return FALSE; | 1197 return FALSE; |
| 1196 | 1198 |
| 1197 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); | 1199 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); |
| 1198 gdk_cairo_rectangle(cr, &event->area); | 1200 gdk_cairo_rectangle(cr, &event->area); |
| 1199 cairo_clip(cr); | 1201 cairo_clip(cr); |
| 1200 | 1202 |
| 1201 GdkColor bottom_color = GetGdkColor(ThemeService::COLOR_TOOLBAR); | 1203 GdkColor bottom_color = GetGdkColor(ThemeService::COLOR_TOOLBAR); |
| 1202 double bottom_color_rgb[] = { | 1204 double bottom_color_rgb[] = { |
| 1203 static_cast<double>(bottom_color.red / 257) / 255.0, | 1205 static_cast<double>(bottom_color.red / 257) / 255.0, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1226 cairo_new_path(cr); | 1228 cairo_new_path(cr); |
| 1227 cairo_set_line_width(cr, 1.0); | 1229 cairo_set_line_width(cr, 1.0); |
| 1228 cairo_move_to(cr, start_x, allocation.y); | 1230 cairo_move_to(cr, start_x, allocation.y); |
| 1229 cairo_line_to(cr, start_x, allocation.y + allocation.height); | 1231 cairo_line_to(cr, start_x, allocation.y + allocation.height); |
| 1230 cairo_stroke(cr); | 1232 cairo_stroke(cr); |
| 1231 cairo_destroy(cr); | 1233 cairo_destroy(cr); |
| 1232 cairo_pattern_destroy(pattern); | 1234 cairo_pattern_destroy(pattern); |
| 1233 | 1235 |
| 1234 return TRUE; | 1236 return TRUE; |
| 1235 } | 1237 } |
| OLD | NEW |