| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/libgtk2ui/gtk2_ui.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 } | 829 } |
| 830 | 830 |
| 831 gfx::FontRenderParams Gtk2UI::GetDefaultFontRenderParams() const { | 831 gfx::FontRenderParams Gtk2UI::GetDefaultFontRenderParams() const { |
| 832 static gfx::FontRenderParams params = GetGtkFontRenderParams(); | 832 static gfx::FontRenderParams params = GetGtkFontRenderParams(); |
| 833 return params; | 833 return params; |
| 834 } | 834 } |
| 835 | 835 |
| 836 void Gtk2UI::GetDefaultFontDescription( | 836 void Gtk2UI::GetDefaultFontDescription( |
| 837 std::string* family_out, | 837 std::string* family_out, |
| 838 int* size_pixels_out, | 838 int* size_pixels_out, |
| 839 bool* italic_out, | 839 int* style_out, |
| 840 gfx::Font::Weight* weight_out, | 840 gfx::Font::Weight* weight_out, |
| 841 gfx::FontRenderParams* params_out) const { | 841 gfx::FontRenderParams* params_out) const { |
| 842 *family_out = default_font_family_; | 842 *family_out = default_font_family_; |
| 843 *size_pixels_out = default_font_size_pixels_; | 843 *size_pixels_out = default_font_size_pixels_; |
| 844 *italic_out = (default_font_style_ & gfx::Font::ITALIC) != 0; | 844 *style_out = default_font_style_; |
| 845 *weight_out = default_font_weight_; | 845 *weight_out = default_font_weight_; |
| 846 *params_out = default_font_render_params_; | 846 *params_out = default_font_render_params_; |
| 847 } | 847 } |
| 848 | 848 |
| 849 ui::SelectFileDialog* Gtk2UI::CreateSelectFileDialog( | 849 ui::SelectFileDialog* Gtk2UI::CreateSelectFileDialog( |
| 850 ui::SelectFileDialog::Listener* listener, | 850 ui::SelectFileDialog::Listener* listener, |
| 851 ui::SelectFilePolicy* policy) const { | 851 ui::SelectFilePolicy* policy) const { |
| 852 return SelectFileDialogImpl::Create(listener, policy); | 852 return SelectFileDialogImpl::Create(listener, policy); |
| 853 } | 853 } |
| 854 | 854 |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 // Blacklist scaling factors <130% (crbug.com/484400) and round | 1403 // Blacklist scaling factors <130% (crbug.com/484400) and round |
| 1404 // to 1 decimal to prevent rendering problems (crbug.com/485183). | 1404 // to 1 decimal to prevent rendering problems (crbug.com/485183). |
| 1405 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; | 1405 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; |
| 1406 } | 1406 } |
| 1407 | 1407 |
| 1408 } // namespace libgtk2ui | 1408 } // namespace libgtk2ui |
| 1409 | 1409 |
| 1410 views::LinuxUI* BuildGtk2UI() { | 1410 views::LinuxUI* BuildGtk2UI() { |
| 1411 return new libgtk2ui::Gtk2UI; | 1411 return new libgtk2ui::Gtk2UI; |
| 1412 } | 1412 } |
| OLD | NEW |