Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/login/l10n_util.h |
| diff --git a/chrome/browser/ui/webui/chromeos/login/l10n_util.h b/chrome/browser/ui/webui/chromeos/login/l10n_util.h |
| index 756e728399e0b68e095d0b406faba2bf2034f76f..9b7860305a3900f448e6adc62bd9f492366a9b26 100644 |
| --- a/chrome/browser/ui/webui/chromeos/login/l10n_util.h |
| +++ b/chrome/browser/ui/webui/chromeos/login/l10n_util.h |
| @@ -10,6 +10,8 @@ |
| #include "base/callback.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/strings/string16.h" |
| +#include "chrome/browser/chromeos/base/locale_util.h" |
| namespace base { |
| class DictionaryValue; |
| @@ -18,6 +20,11 @@ class ListValue; |
| namespace chromeos { |
| +typedef base::Callback<void(scoped_ptr<base::ListValue> /* new_language_list */, |
| + std::string /* new_language_list_locale */, |
| + std::string /* new_selected_language */)> |
| + UILanguageListResolvedCallback; |
| + |
| // GetUILanguageList() returns a concatenated list of the most relevant |
| // languages followed by all others. An entry with its "code" attribute set to |
| // this value is inserted in between. |
| @@ -26,6 +33,12 @@ extern const char kMostRelevantLanguagesDivider[]; |
| // Utility methods for retrieving lists of supported locales and input methods / |
| // keyboard layouts during OOBE and on the login screen. |
| +// Helper function for GetUILanguageList. |
| +// Requires |language_display_name| after |
| +// base::i18n::UnadjustStringForLocaleDirection. |
| +const std::string GetLanguageDirectionality( |
| + const base::string16& language_display_name); |
| + |
| // Return a list of languages in which the UI can be shown. Each list entry is a |
| // dictionary that contains data such as the language's locale code and a |
| // display name. The list will consist of the |most_relevant_language_codes|, |
| @@ -37,6 +50,17 @@ scoped_ptr<base::ListValue> GetUILanguageList( |
| const std::vector<std::string>* most_relevant_language_codes, |
| const std::string& selected); |
| +// Must be called on UI thread. Runs GetUILanguageList(), on Blocking Pool, |
| +// and calls |callback| on UI thread with result. |
| +void ResolveUILanguageList( |
| + scoped_ptr<locale_util::LanguageSwitchResult> language_switch_result, |
|
dzhioev (left Google)
2014/10/02 14:12:10
Please, describe in a comment what's happening whe
Alexander Alekseev
2014/10/02 19:05:03
Done.
|
| + UILanguageListResolvedCallback callback); |
| + |
| +// Returns a minimal list of UI languages, which consists of active language |
| +// only. It is used as a placeholder until ResolveUILanguageList() finishes |
| +// on BlockingPool. |
| +scoped_ptr<base::ListValue> GetMinimalUILanguageList(); |
| + |
| // Returns the most first entry of |most_relevant_language_codes| that is |
| // actually available (present in |available_locales|). If none of the entries |
| // are present in |available_locales|, returns the |fallback_locale|. |