OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ui/base/l10n/l10n_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 #include <iterator> | 9 #include <iterator> |
10 #include <memory> | 10 #include <memory> |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 270 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
271 if (base::i18n::IsRTL() && | 271 if (base::i18n::IsRTL() && |
272 base::i18n::StringContainsStrongRTLChars(*paragraph)) { | 272 base::i18n::StringContainsStrongRTLChars(*paragraph)) { |
273 paragraph->insert(0, 1, | 273 paragraph->insert(0, 1, |
274 static_cast<base::char16>(base::i18n::kRightToLeftMark)); | 274 static_cast<base::char16>(base::i18n::kRightToLeftMark)); |
275 } | 275 } |
276 #endif | 276 #endif |
277 } | 277 } |
278 | 278 |
279 struct AvailableLocalesTraits | 279 struct AvailableLocalesTraits |
280 : base::DefaultLazyInstanceTraits<std::vector<std::string> > { | 280 : base::LazyInstanceTraitsBase<std::vector<std::string>> { |
281 static std::vector<std::string>* New(void* instance) { | 281 static std::vector<std::string>* New(void* instance) { |
282 std::vector<std::string>* locales = | 282 std::vector<std::string>* locales = |
283 base::DefaultLazyInstanceTraits<std::vector<std::string> >::New( | 283 base::LazyInstanceTraitsBase<std::vector<std::string>>::New(instance); |
284 instance); | |
285 int num_locales = uloc_countAvailable(); | 284 int num_locales = uloc_countAvailable(); |
286 for (int i = 0; i < num_locales; ++i) { | 285 for (int i = 0; i < num_locales; ++i) { |
287 std::string locale_name = uloc_getAvailable(i); | 286 std::string locale_name = uloc_getAvailable(i); |
288 // Filter out the names that have aliases. | 287 // Filter out the names that have aliases. |
289 if (IsDuplicateName(locale_name)) | 288 if (IsDuplicateName(locale_name)) |
290 continue; | 289 continue; |
291 // Filter out locales for which we have only partially populated data | 290 // Filter out locales for which we have only partially populated data |
292 // and to which Chrome is not localized. | 291 // and to which Chrome is not localized. |
293 if (IsLocalePartiallyPopulated(locale_name)) | 292 if (IsLocalePartiallyPopulated(locale_name)) |
294 continue; | 293 continue; |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 | 878 |
880 const char* const* GetAcceptLanguageListForTesting() { | 879 const char* const* GetAcceptLanguageListForTesting() { |
881 return kAcceptLanguageList; | 880 return kAcceptLanguageList; |
882 } | 881 } |
883 | 882 |
884 size_t GetAcceptLanguageListSizeForTesting() { | 883 size_t GetAcceptLanguageListSizeForTesting() { |
885 return arraysize(kAcceptLanguageList); | 884 return arraysize(kAcceptLanguageList); |
886 } | 885 } |
887 | 886 |
888 } // namespace l10n_util | 887 } // namespace l10n_util |
OLD | NEW |