OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 |
| 13 namespace base { |
| 14 class ListValue; |
| 15 } |
| 16 |
| 17 namespace chromeos { |
| 18 |
| 19 // GetUILanguageList() returns a concatenated list of the most relevant |
| 20 // languages followed by all others. An entry with its "code" attribute set to |
| 21 // this value is inserted in between. |
| 22 extern const char kMostRelevantLanguagesDivider[]; |
| 23 |
| 24 // Utility methods for retrieving lists of supported locales and input methods / |
| 25 // keyboard layouts during OOBE and on the login screen. |
| 26 |
| 27 // Return a list of languages in which the UI can be shown. Each list entry is a |
| 28 // dictionary that contains data such as the language's locale code and a |
| 29 // display name. The list will consist of the |most_relevant_language_codes|, |
| 30 // followed by a divider and all other supported languages after that. If |
| 31 // |most_relevant_language_codes| is NULL, the most relevant languages are read |
| 32 // from initial_locale in VPD. If |selected| matches the locale code of any |
| 33 // entry in the resulting list, that entry will be marked as selected. |
| 34 scoped_ptr<base::ListValue> GetUILanguageList( |
| 35 const std::vector<std::string>* most_relevant_language_codes, |
| 36 const std::string& selected); |
| 37 |
| 38 // Return a list of supported accept languages. The listed languages can be used |
| 39 // in the Accept-Language header. The return value will look like: |
| 40 // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'}, ...] |
| 41 // The most relevant languages, read from initial_locale in VPD, will be first |
| 42 // in the list. |
| 43 scoped_ptr<base::ListValue> GetAcceptLanguageList(); |
| 44 |
| 45 // Return a list of keyboard layouts that can be used for |locale| on the login |
| 46 // screen. Each list entry is a dictionary that contains data such as an ID and |
| 47 // a display name. The list will consist of the device's hardware layouts, |
| 48 // followed by a divider and locale-specific keyboard layouts, if any. The list |
| 49 // will also always contain the US keyboard layout. If |selected| matches the ID |
| 50 // of any entry in the resulting list, that entry will be marked as selected. |
| 51 // In addition to returning the list of keyboard layouts, this function also |
| 52 // activates them so that they can be selected by the user (e.g. by cycling |
| 53 // through keyboard layouts via keyboard shortcuts). |
| 54 scoped_ptr<base::ListValue> GetLoginKeyboardLayouts( |
| 55 const std::string& locale, |
| 56 const std::string& selected); |
| 57 |
| 58 } // namespace chromeos |
| 59 |
| 60 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ |
OLD | NEW |