Chromium Code Reviews| Index: ui/gfx/platform_font_pango.cc |
| diff --git a/ui/gfx/platform_font_pango.cc b/ui/gfx/platform_font_pango.cc |
| index 6da7c2dbb4efe5421fbc352496988471bc1c02d5..008f0dfddbecebc4c4017c6db91fffa227a48318 100644 |
| --- a/ui/gfx/platform_font_pango.cc |
| +++ b/ui/gfx/platform_font_pango.cc |
| @@ -74,19 +74,22 @@ std::string* PlatformFontPango::default_font_description_ = NULL; |
| PlatformFontPango::PlatformFontPango() { |
| if (!default_font_) { |
| - std::string desc_string; |
| + scoped_ptr<ScopedPangoFontDescription> description; |
| #if defined(OS_CHROMEOS) |
| - // Font name must have been provided by way of SetDefaultFontDescription(). |
| CHECK(default_font_description_); |
| - desc_string = *default_font_description_; |
| + description.reset(new ScopedPangoFontDescription( |
| + pango_font_description_from_string( |
| + default_font_description_->c_str()))); |
| #else |
| const gfx::LinuxFontDelegate* delegate = gfx::LinuxFontDelegate::instance(); |
| - desc_string = delegate ? delegate->GetDefaultFontDescription() : "sans 10"; |
| + if (delegate) { |
| + description = delegate->GetDefaultPangoFontDescription(); |
| + } else { |
|
msw
2014/07/18 19:59:46
Should this be a separate check like "if (!descrip
Daniel Erat
2014/07/18 20:26:52
sure. i'd prefer to have the delegate only return
|
| + description.reset(new ScopedPangoFontDescription( |
| + pango_font_description_from_string("sans 10"))); |
| + } |
| #endif |
| - |
| - ScopedPangoFontDescription desc( |
| - pango_font_description_from_string(desc_string.c_str())); |
| - default_font_ = new Font(desc.get()); |
| + default_font_ = new Font(description->get()); |
| } |
| InitFromPlatformFont( |