| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 | 9 |
| 10 #include "app/l10n_util_win.h" | 10 #include "app/l10n_util_win.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style); | 56 ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style); |
| 57 | 57 |
| 58 // Right-to-left layout changes are not applied to the window immediately | 58 // Right-to-left layout changes are not applied to the window immediately |
| 59 // so we should make sure a WM_PAINT is sent to the window by invalidating | 59 // so we should make sure a WM_PAINT is sent to the window by invalidating |
| 60 // the entire window rect. | 60 // the entire window rect. |
| 61 ::InvalidateRect(hwnd, NULL, true); | 61 ::InvalidateRect(hwnd, NULL, true); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool IsLocaleSupportedByOS(const std::string& locale) { | 65 bool IsLocaleSupportedByOS(const std::string& locale) { |
| 66 // Block Oriya and Amharic on Windows XP. | 66 // Block Amharic on Windows XP. |
| 67 return win_util::GetWinVersion() >= win_util::WINVERSION_VISTA || | 67 return win_util::GetWinVersion() >= win_util::WINVERSION_VISTA || |
| 68 (!LowerCaseEqualsASCII(locale, "or") && | 68 !LowerCaseEqualsASCII(locale, "am"); |
| 69 !LowerCaseEqualsASCII(locale, "am")); | |
| 70 } | 69 } |
| 71 | 70 |
| 72 bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, | 71 bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, |
| 73 double* font_size_scaler) { | 72 double* font_size_scaler) { |
| 74 // This is rather simple-minded to deal with the UI font size | 73 // This is rather simple-minded to deal with the UI font size |
| 75 // issue for some Indian locales (ml, bn, hi) for which | 74 // issue for some Indian locales (ml, bn, hi) for which |
| 76 // the default Windows fonts are too small to be legible. For those | 75 // the default Windows fonts are too small to be legible. For those |
| 77 // locales, IDS_UI_FONT_FAMILY is set to an actual font family to | 76 // locales, IDS_UI_FONT_FAMILY is set to an actual font family to |
| 78 // use while for other locales, it's set to 'default'. | 77 // use while for other locales, it's set to 'default'. |
| 79 | 78 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 if (GetObject(GetWindowFont(hwnd), sizeof(logfont), &logfont)) { | 117 if (GetObject(GetWindowFont(hwnd), sizeof(logfont), &logfont)) { |
| 119 AdjustLogFont(ui_font_family, ui_font_size_scaler, &logfont); | 118 AdjustLogFont(ui_font_family, ui_font_size_scaler, &logfont); |
| 120 HFONT hfont = CreateFontIndirect(&logfont); | 119 HFONT hfont = CreateFontIndirect(&logfont); |
| 121 if (hfont) | 120 if (hfont) |
| 122 SetWindowFont(hwnd, hfont, FALSE); | 121 SetWindowFont(hwnd, hfont, FALSE); |
| 123 } | 122 } |
| 124 } | 123 } |
| 125 } | 124 } |
| 126 | 125 |
| 127 } // namespace l10n_util | 126 } // namespace l10n_util |
| OLD | NEW |