| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/base/l10n/l10n_util_win.h" | 5 #include "ui/base/l10n/l10n_util_win.h" |
| 6 | 6 |
| 7 #include <windowsx.h> | 7 #include <windowsx.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <iterator> | 9 #include <iterator> |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 ::InvalidateRect(hwnd, NULL, true); | 104 ::InvalidateRect(hwnd, NULL, true); |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool IsLocaleSupportedByOS(const std::string& locale) { | 108 bool IsLocaleSupportedByOS(const std::string& locale) { |
| 109 // Block Amharic on Windows XP unless 'Abyssinica SIL' font is present. | 109 // Block Amharic on Windows XP unless 'Abyssinica SIL' font is present. |
| 110 // On Win XP, no Ethiopic/Amahric font is availabel out of box. We hard-coded | 110 // On Win XP, no Ethiopic/Amahric font is availabel out of box. We hard-coded |
| 111 // 'Abyssinica SIL' in the resource bundle to use in the UI. Check | 111 // 'Abyssinica SIL' in the resource bundle to use in the UI. Check |
| 112 // for its presence to determine whether or not to support Amharic UI on XP. | 112 // for its presence to determine whether or not to support Amharic UI on XP. |
| 113 return (base::win::GetVersion() >= base::win::VERSION_VISTA || | 113 return (base::win::GetVersion() >= base::win::VERSION_VISTA || |
| 114 !LowerCaseEqualsASCII(locale, "am") || IsFontPresent(L"Abyssinica SIL")); | 114 !base::LowerCaseEqualsASCII(locale, "am") || |
| 115 IsFontPresent(L"Abyssinica SIL")); |
| 115 } | 116 } |
| 116 | 117 |
| 117 bool NeedOverrideDefaultUIFont(base::string16* override_font_family, | 118 bool NeedOverrideDefaultUIFont(base::string16* override_font_family, |
| 118 double* font_size_scaler) { | 119 double* font_size_scaler) { |
| 119 // This is rather simple-minded to deal with the UI font size | 120 // This is rather simple-minded to deal with the UI font size |
| 120 // issue for some Indian locales (ml, bn, hi) for which | 121 // issue for some Indian locales (ml, bn, hi) for which |
| 121 // the default Windows fonts are too small to be legible. For those | 122 // the default Windows fonts are too small to be legible. For those |
| 122 // locales, IDS_UI_FONT_FAMILY is set to an actual font family to | 123 // locales, IDS_UI_FONT_FAMILY is set to an actual font family to |
| 123 // use while for other locales, it's set to 'default'. | 124 // use while for other locales, it's set to 'default'. |
| 124 | 125 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } else { | 197 } else { |
| 197 NOTREACHED() << "Failed to determine the UI language for locale override."; | 198 NOTREACHED() << "Failed to determine the UI language for locale override."; |
| 198 } | 199 } |
| 199 } | 200 } |
| 200 | 201 |
| 201 const std::vector<std::string>& GetLocaleOverrides() { | 202 const std::vector<std::string>& GetLocaleOverrides() { |
| 202 return override_locale_holder.Get().value(); | 203 return override_locale_holder.Get().value(); |
| 203 } | 204 } |
| 204 | 205 |
| 205 } // namespace l10n_util | 206 } // namespace l10n_util |
| OLD | NEW |