| 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 #include "app/l10n_util_win.h" | 6 #include "app/l10n_util_win.h" |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <windowsx.h> | 9 #include <windowsx.h> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 ex_style |= WS_EX_LAYOUTRTL; | 55 ex_style |= WS_EX_LAYOUTRTL; |
| 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::wstring& locale) { | 65 bool IsLocaleSupportedByOS(const std::string& locale) { |
| 66 // Block Oriya on Windows XP. | 66 // Block Oriya on Windows XP. |
| 67 return !(LowerCaseEqualsASCII(locale, "or") && | 67 return !(LowerCaseEqualsASCII(locale, "or") && |
| 68 win_util::GetWinVersion() < win_util::WINVERSION_VISTA); | 68 win_util::GetWinVersion() < win_util::WINVERSION_VISTA); |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, | 71 bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, |
| 72 double* font_size_scaler) { | 72 double* font_size_scaler) { |
| 73 // 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 |
| 74 // issue for some Indian locales (ml, bn, hi) for which | 74 // issue for some Indian locales (ml, bn, hi) for which |
| 75 // 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 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 if (GetObject(GetWindowFont(hwnd), sizeof(logfont), &logfont)) { | 117 if (GetObject(GetWindowFont(hwnd), sizeof(logfont), &logfont)) { |
| 118 AdjustLogFont(ui_font_family, ui_font_size_scaler, &logfont); | 118 AdjustLogFont(ui_font_family, ui_font_size_scaler, &logfont); |
| 119 HFONT hfont = CreateFontIndirect(&logfont); | 119 HFONT hfont = CreateFontIndirect(&logfont); |
| 120 if (hfont) | 120 if (hfont) |
| 121 SetWindowFont(hwnd, hfont, FALSE); | 121 SetWindowFont(hwnd, hfont, FALSE); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace l10n_util | 126 } // namespace l10n_util |
| OLD | NEW |