OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/tab_strip_gtk.h" | 5 #include "chrome/browser/gtk/tab_strip_gtk.h" |
6 | 6 |
7 #include "base/gfx/gtk_util.h" | 7 #include "base/gfx/gtk_util.h" |
8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
10 #include "chrome/common/l10n_util.h" | 10 #include "chrome/common/l10n_util.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 GValue value = { 0 }; | 44 GValue value = { 0 }; |
45 g_value_init(&value, G_TYPE_STRING); | 45 g_value_init(&value, G_TYPE_STRING); |
46 g_object_get_property(G_OBJECT(settings), "gtk-font-name", &value); | 46 g_object_get_property(G_OBJECT(settings), "gtk-font-name", &value); |
47 | 47 |
48 gchar* font_name = g_strdup_value_contents(&value); | 48 gchar* font_name = g_strdup_value_contents(&value); |
49 PangoFontDescription* font_description = pango_font_description_from_string( | 49 PangoFontDescription* font_description = pango_font_description_from_string( |
50 font_name); | 50 font_name); |
51 | 51 |
52 GdkFont* font = gdk_font_from_description(font_description); | 52 GdkFont* font = gdk_font_from_description(font_description); |
53 free(font_name); | 53 g_free(font_name); |
54 return font; | 54 return font; |
55 } | 55 } |
56 | 56 |
57 } // namespace | 57 } // namespace |
58 | 58 |
59 bool TabStripGtk::initialized_ = false; | 59 bool TabStripGtk::initialized_ = false; |
60 TabStripGtk::TabImage TabStripGtk::tab_active_ = {0}; | 60 TabStripGtk::TabImage TabStripGtk::tab_active_ = {0}; |
61 TabStripGtk::TabImage TabStripGtk::tab_inactive_ = {0}; | 61 TabStripGtk::TabImage TabStripGtk::tab_inactive_ = {0}; |
62 TabStripGtk::TabImage TabStripGtk::tab_inactive_otr_ = {0}; | 62 TabStripGtk::TabImage TabStripGtk::tab_inactive_otr_ = {0}; |
63 TabStripGtk::TabImage TabStripGtk::tab_hover_ = {0}; | 63 TabStripGtk::TabImage TabStripGtk::tab_hover_ = {0}; |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 LoadTabImages(); | 492 LoadTabImages(); |
493 | 493 |
494 // TODO(jhawkins): Move this into ChromeFont. Also, my default gtk font | 494 // TODO(jhawkins): Move this into ChromeFont. Also, my default gtk font |
495 // is really ugly compared to the other fonts being used in the UI. | 495 // is really ugly compared to the other fonts being used in the UI. |
496 title_font_ = load_default_font(); | 496 title_font_ = load_default_font(); |
497 DCHECK(title_font_); | 497 DCHECK(title_font_); |
498 title_font_height_ = gdk_char_height(title_font_, 'X'); | 498 title_font_height_ = gdk_char_height(title_font_, 'X'); |
499 initialized_ = true; | 499 initialized_ = true; |
500 } | 500 } |
OLD | NEW |