| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 std::back_inserter(candidates), | 452 std::back_inserter(candidates), |
| 453 &base::i18n::GetCanonicalLocale); | 453 &base::i18n::GetCanonicalLocale); |
| 454 } else { | 454 } else { |
| 455 // If no override was set, defer to ICU | 455 // If no override was set, defer to ICU |
| 456 candidates.push_back(base::i18n::GetConfiguredLocale()); | 456 candidates.push_back(base::i18n::GetConfiguredLocale()); |
| 457 } | 457 } |
| 458 | 458 |
| 459 #elif defined(OS_ANDROID) | 459 #elif defined(OS_ANDROID) |
| 460 | 460 |
| 461 // On Android, query java.util.Locale for the default locale. | 461 // On Android, query java.util.Locale for the default locale. |
| 462 candidates.push_back(base::android::GetDefaultLocale()); | 462 candidates.push_back(base::android::GetDefaultLocaleString()); |
| 463 | 463 |
| 464 #elif defined(USE_GLIB) && !defined(OS_CHROMEOS) | 464 #elif defined(USE_GLIB) && !defined(OS_CHROMEOS) |
| 465 | 465 |
| 466 // GLib implements correct environment variable parsing with | 466 // GLib implements correct environment variable parsing with |
| 467 // the precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG. | 467 // the precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG. |
| 468 // We used to use our custom parsing code along with ICU for this purpose. | 468 // We used to use our custom parsing code along with ICU for this purpose. |
| 469 // If we have a port that does not depend on GTK, we have to | 469 // If we have a port that does not depend on GTK, we have to |
| 470 // restore our custom code for that port. | 470 // restore our custom code for that port. |
| 471 const char* const* languages = g_get_language_names(); | 471 const char* const* languages = g_get_language_names(); |
| 472 DCHECK(languages); // A valid pointer is guaranteed. | 472 DCHECK(languages); // A valid pointer is guaranteed. |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 | 882 |
| 883 const char* const* GetAcceptLanguageListForTesting() { | 883 const char* const* GetAcceptLanguageListForTesting() { |
| 884 return kAcceptLanguageList; | 884 return kAcceptLanguageList; |
| 885 } | 885 } |
| 886 | 886 |
| 887 size_t GetAcceptLanguageListSizeForTesting() { | 887 size_t GetAcceptLanguageListSizeForTesting() { |
| 888 return arraysize(kAcceptLanguageList); | 888 return arraysize(kAcceptLanguageList); |
| 889 } | 889 } |
| 890 | 890 |
| 891 } // namespace l10n_util | 891 } // namespace l10n_util |
| OLD | NEW |