| Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| index 4816c62c9edfced03998867dd534d1db24136e12..5e16ba7dd2028d901420160102e503c09a16250e 100644
|
| --- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| +++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| @@ -4,7 +4,6 @@
|
|
|
| #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
|
|
|
| -#include <math.h>
|
| #include <set>
|
|
|
| #include <pango/pango.h>
|
| @@ -381,20 +380,16 @@ gfx::FontRenderParams GetGtkFontRenderParams() {
|
| return params;
|
| }
|
|
|
| -double GetDPI() {
|
| +// Queries GTK for its font DPI setting and returns the number of pixels in a
|
| +// point.
|
| +double GetPixelsInPoint(float device_scale_factor) {
|
| GtkSettings* gtk_settings = gtk_settings_get_default();
|
| CHECK(gtk_settings);
|
| gint gtk_dpi = -1;
|
| g_object_get(gtk_settings, "gtk-xft-dpi", >k_dpi, NULL);
|
|
|
| // GTK multiplies the DPI by 1024 before storing it.
|
| - return (gtk_dpi > 0) ? gtk_dpi / 1024.0 : 96.0;
|
| -}
|
| -
|
| -// Queries GTK for its font DPI setting and returns the number of pixels in a
|
| -// point.
|
| -double GetPixelsInPoint(float device_scale_factor) {
|
| - double dpi = GetDPI();
|
| + double dpi = (gtk_dpi > 0) ? gtk_dpi / 1024.0 : 96.0;
|
|
|
| // Take device_scale_factor into account — if Chrome already scales the
|
| // entire UI up by 2x, we should not also scale up.
|
| @@ -1425,13 +1420,6 @@ void Gtk2UI::UpdateDeviceScaleFactor(float device_scale_factor) {
|
| UpdateDefaultFont(label_style->font_desc);
|
| }
|
|
|
| -float Gtk2UI::GetDeviceScaleFactor() const {
|
| - const int kCSSDefaultDPI = 96;
|
| - float scale = GetDPI() / kCSSDefaultDPI;
|
| - // Round to 2 decimals, e.g. to 1.33.
|
| - return roundf(scale * 100) / 100;
|
| -}
|
| -
|
| } // namespace libgtk2ui
|
|
|
| views::LinuxUI* BuildGtk2UI() {
|
|
|