summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 17:48:36 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 17:48:36 +0000
commit3c95d67ff13f13b54f3aa2aac922fe7518e9e0af (patch)
tree1a6dd6a08bd4238d4aaa0b29b4510a8349c43718 /app
parentd665821077e39e2dcc85d6fbaaaaf0620631aefc (diff)
downloadchromium_src-3c95d67ff13f13b54f3aa2aac922fe7518e9e0af.zip
chromium_src-3c95d67ff13f13b54f3aa2aac922fe7518e9e0af.tar.gz
chromium_src-3c95d67ff13f13b54f3aa2aac922fe7518e9e0af.tar.bz2
When the resource bundle is not available, the UI font family and the UI font size should follow the OS settings.
Add a guard against cases when the resource bundle is not available, which should not happen in the first place. BUG=http://crbug.com/12309 Review URL: http://codereview.chromium.org/113916 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/l10n_util_win.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/l10n_util_win.cc b/app/l10n_util_win.cc
index 52456f3..03415d1 100644
--- a/app/l10n_util_win.cc
+++ b/app/l10n_util_win.cc
@@ -87,7 +87,13 @@ bool NeedOverrideDefaultUIFont(std::wstring* override_font_family,
std::wstring ui_font_family = GetString(ui_font_family_id);
int scaler100 = StringToInt(l10n_util::GetString(ui_font_size_scaler_id));
- if (ui_font_family == L"default" && scaler100 == 100)
+ // We use the OS default in two cases:
+ // 1) The resource bundle has 'default' and '100' for font family and
+ // font scaler.
+ // 2) The resource bundle is not available for some reason and
+ // ui_font_family is empty.
+ if (ui_font_family == L"default" && scaler100 == 100 ||
+ ui_font_family.empty())
return false;
if (override_font_family && font_size_scaler) {
override_font_family->swap(ui_font_family);