summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 21:34:29 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 21:34:29 +0000
commitea500fc6e9828bc028a26b5be33d102a260cfc05 (patch)
treeb2dc64ee3cf7b4f9ea825552a2eefe514cf7a8fe /chrome/browser
parent8f6f202305d14eef7c3813bc41985f90e28a8f15 (diff)
downloadchromium_src-ea500fc6e9828bc028a26b5be33d102a260cfc05.zip
chromium_src-ea500fc6e9828bc028a26b5be33d102a260cfc05.tar.gz
chromium_src-ea500fc6e9828bc028a26b5be33d102a260cfc05.tar.bz2
Make gfx::Font use callbacks to perform locale-dependent font adjustments. Also cleans up some of the last remaining l10n_util usages within app/gfx in preparation for moving these files to toplevel gfx.
BUG=none TEST=none Review URL: http://codereview.chromium.org/1110008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_main.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index abf9cb5..c160379 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -60,6 +60,7 @@
#include "chrome/common/result_codes.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/master_preferences.h"
+#include "grit/app_locale_settings.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "net/base/cookie_monster.h"
@@ -97,6 +98,7 @@
#include <commctrl.h>
#include <shellapi.h>
+#include "app/l10n_util_win.h"
#include "app/win_util.h"
#include "base/nss_util.h"
#include "base/registry.h"
@@ -331,6 +333,19 @@ class GetLinuxDistroTask : public Task {
DISALLOW_COPY_AND_ASSIGN(GetLinuxDistroTask);
};
#endif // USE_LINUX_BREAKPAD
+
+#if defined(OS_WIN)
+
+// gfx::Font callbacks
+void AdjustUIFont(LOGFONT* logfont) {
+ l10n_util::AdjustUIFont(logfont);
+}
+
+int GetMinimumFontSize() {
+ return StringToInt(l10n_util::GetString(IDS_MINIMUM_UI_FONT_SIZE).c_str());
+}
+
+#endif
} // namespace
// Main routine for running as the Browser process.
@@ -548,7 +563,10 @@ int BrowserMain(const MainFunctionParams& parameters) {
if (!views::ViewsDelegate::views_delegate)
views::ViewsDelegate::views_delegate = new ChromeViewsDelegate;
#endif
-
+#if defined(OS_WIN)
+ gfx::Font::adjust_font_callback = &AdjustUIFont;
+ gfx::Font::get_minimum_font_size_callback = &GetMinimumFontSize;
+#endif
if (is_first_run) {
#if defined(OS_WIN)