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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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 652e04e719525343d02f82ecd74110bcc623c0b5..73458c6db4b5f1236232dc6c469e794141407baf 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
+#include <math.h>
#include <set>
#include <pango/pango.h>
@@ -1427,8 +1428,9 @@ void Gtk2UI::UpdateDeviceScaleFactor(float device_scale_factor) {
float Gtk2UI::GetDeviceScaleFactor() const {
const int kCSSDefaultDPI = 96;
- const float scale = GetDPI() / kCSSDefaultDPI;
- return ui::GetScaleForScaleFactor(ui::GetSupportedScaleFactor(scale));
+ float scale = GetDPI() / kCSSDefaultDPI;
+ // Round to 2 decimals, e.g. to 1.33.
+ return roundf(scale * 100) / 100;
}
} // namespace libgtk2ui
« no previous file with comments | « chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc ('k') | chrome/browser/ui/login/login_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698