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

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 1324513002: Blacklist low scale factors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <set> 8 #include <set>
9 9
10 #include <pango/pango.h> 10 #include <pango/pango.h>
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 void Gtk2UI::UpdateDeviceScaleFactor(float device_scale_factor) { 1431 void Gtk2UI::UpdateDeviceScaleFactor(float device_scale_factor) {
1432 device_scale_factor_ = device_scale_factor; 1432 device_scale_factor_ = device_scale_factor;
1433 GtkStyle* label_style = gtk_rc_get_style(fake_label_.get()); 1433 GtkStyle* label_style = gtk_rc_get_style(fake_label_.get());
1434 UpdateDefaultFont(label_style->font_desc); 1434 UpdateDefaultFont(label_style->font_desc);
1435 } 1435 }
1436 1436
1437 float Gtk2UI::GetDeviceScaleFactor() const { 1437 float Gtk2UI::GetDeviceScaleFactor() const {
1438 if (gfx::Display::HasForceDeviceScaleFactor()) 1438 if (gfx::Display::HasForceDeviceScaleFactor())
1439 return gfx::Display::GetForcedDeviceScaleFactor(); 1439 return gfx::Display::GetForcedDeviceScaleFactor();
1440 const int kCSSDefaultDPI = 96; 1440 const int kCSSDefaultDPI = 96;
1441 float scale = GetDPI() / kCSSDefaultDPI; 1441 const float scale = GetDPI() / kCSSDefaultDPI;
1442 // Round to 1 decimal, e.g. to 1.4. 1442 // Round to 1 decimal, e.g. to 1.4.
1443 return roundf(scale * 10) / 10; 1443 const float rounded = roundf(scale * 10) / 10;
1444 // See crbug.com/484400
1445 return (rounded < 1.3 ? 1.0 : rounded);
Evan Stade 2015/08/28 14:54:11 nit, no parens
1444 } 1446 }
1445 1447
1446 } // namespace libgtk2ui 1448 } // namespace libgtk2ui
1447 1449
1448 views::LinuxUI* BuildGtk2UI() { 1450 views::LinuxUI* BuildGtk2UI() {
1449 return new libgtk2ui::Gtk2UI; 1451 return new libgtk2ui::Gtk2UI;
1450 } 1452 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698