Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: chrome/browser/ui/gtk/gtk_theme_service.cc

Issue 8800029: GTK: Add TRACE_EVENTs around gtk ui events. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix nit Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 } 1198 }
1198 1199
1199 void GtkThemeService::OnDestroyLabel(GtkWidget* button) { 1200 void GtkThemeService::OnDestroyLabel(GtkWidget* button) {
1200 std::map<GtkWidget*, GdkColor>::iterator it = labels_.find(button); 1201 std::map<GtkWidget*, GdkColor>::iterator it = labels_.find(button);
1201 if (it != labels_.end()) 1202 if (it != labels_.end())
1202 labels_.erase(it); 1203 labels_.erase(it);
1203 } 1204 }
1204 1205
1205 gboolean GtkThemeService::OnSeparatorExpose(GtkWidget* widget, 1206 gboolean GtkThemeService::OnSeparatorExpose(GtkWidget* widget,
1206 GdkEventExpose* event) { 1207 GdkEventExpose* event) {
1208 UNSHIPPED_TRACE_EVENT0("ui::gtk", "GtkThemeService::OnSeparatorExpose");
1207 if (UsingNativeTheme()) 1209 if (UsingNativeTheme())
1208 return FALSE; 1210 return FALSE;
1209 1211
1210 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); 1212 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
1211 gdk_cairo_rectangle(cr, &event->area); 1213 gdk_cairo_rectangle(cr, &event->area);
1212 cairo_clip(cr); 1214 cairo_clip(cr);
1213 1215
1214 GdkColor bottom_color = GetGdkColor(ThemeService::COLOR_TOOLBAR); 1216 GdkColor bottom_color = GetGdkColor(ThemeService::COLOR_TOOLBAR);
1215 double bottom_color_rgb[] = { 1217 double bottom_color_rgb[] = {
1216 static_cast<double>(bottom_color.red / 257) / 255.0, 1218 static_cast<double>(bottom_color.red / 257) / 255.0,
(...skipping 22 matching lines...) Expand all
1239 cairo_new_path(cr); 1241 cairo_new_path(cr);
1240 cairo_set_line_width(cr, 1.0); 1242 cairo_set_line_width(cr, 1.0);
1241 cairo_move_to(cr, start_x, allocation.y); 1243 cairo_move_to(cr, start_x, allocation.y);
1242 cairo_line_to(cr, start_x, allocation.y + allocation.height); 1244 cairo_line_to(cr, start_x, allocation.y + allocation.height);
1243 cairo_stroke(cr); 1245 cairo_stroke(cr);
1244 cairo_destroy(cr); 1246 cairo_destroy(cr);
1245 cairo_pattern_destroy(pattern); 1247 cairo_pattern_destroy(pattern);
1246 1248
1247 return TRUE; 1249 return TRUE;
1248 } 1250 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698