summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sync_setup_flow.cc
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 05:45:15 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 05:45:15 +0000
commite011c17e1eabfafeadf757d6613b46f14ee8fad4 (patch)
treeb860bfd2a63ea29bfe5b7c68138932ea39f6b4ce /chrome/browser/sync/sync_setup_flow.cc
parentc61cc652f61fe89b5b1ccb7156896ba11cc0c7f1 (diff)
downloadchromium_src-e011c17e1eabfafeadf757d6613b46f14ee8fad4.zip
chromium_src-e011c17e1eabfafeadf757d6613b46f14ee8fad4.tar.gz
chromium_src-e011c17e1eabfafeadf757d6613b46f14ee8fad4.tar.bz2
Added scale hack to work around Windows font metric issue.
BUG=none TESTED=tested sync setup wizard on OS X Review URL: http://codereview.chromium.org/348070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30946 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sync_setup_flow.cc')
-rw-r--r--chrome/browser/sync/sync_setup_flow.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index 4f60825..cf60350 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.