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

Unified Diff: chrome/browser/sync/sync_setup_flow.cc

Issue 348070: Added scale hack to work around Windows font metric issue. (Closed)
Patch Set: Created 11 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_setup_flow.cc
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index 4f60825fcb3317376bf225d8a5f171541ce02f1d..cf603509bfaa287e0224d9d22f923093f9267491 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -155,13 +155,24 @@ void SyncSetupFlow::GetDialogSize(gfx::Size* size) const {
prefs->GetString(prefs::kWebKitSansSerifFontFamily),
prefs->GetInteger(prefs::kWebKitDefaultFontSize));
- gfx::Size s = gfx::GetLocalizedContentsSizeForFont(
+ *size = gfx::GetLocalizedContentsSizeForFont(
IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS,
IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES,
approximate_web_font);
- size->set_width(s.width());
- size->set_height(s.height());
+#if !defined(OS_WIN)
+ // NOTE(akalin): This is a hack to work around a problem with font height on
+ // windows. Basically font metrics are incorrectly returned in logical units
+ // instead of pixels on Windows. Logical units are very commonly 96 DPI
+ // so our localized char/line counts are too small by a factor of 96/72.
+ // So we compensate for this on non-windows platform.
+ //
+ // TODO(akalin): Remove this hack once we fix the windows font problem (or at
+ // least work around it in some other place).
+ float scale_hack = 96.f/72.f;
+ size->set_width(size->width() * scale_hack);
+ size->set_height(size->height() * scale_hack);
+#endif
}
// A callback to notify the delegate that the dialog closed.
« 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