OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 // Return a list of keyboard layouts that can be used for |locale| on the login | 47 // Return a list of keyboard layouts that can be used for |locale| on the login |
48 // screen. Each list entry is a dictionary that contains data such as an ID and | 48 // screen. Each list entry is a dictionary that contains data such as an ID and |
49 // a display name. The list will consist of the device's hardware layouts, | 49 // a display name. The list will consist of the device's hardware layouts, |
50 // followed by a divider and locale-specific keyboard layouts, if any. The list | 50 // followed by a divider and locale-specific keyboard layouts, if any. The list |
51 // will also always contain the US keyboard layout. If |selected| matches the ID | 51 // will also always contain the US keyboard layout. If |selected| matches the ID |
52 // of any entry in the resulting list, that entry will be marked as selected. | 52 // of any entry in the resulting list, that entry will be marked as selected. |
53 // In addition to returning the list of keyboard layouts, this function also | 53 // In addition to returning the list of keyboard layouts, this function also |
54 // activates them so that they can be selected by the user (e.g. by cycling | 54 // activates them so that they can be selected by the user (e.g. by cycling |
55 // through keyboard layouts via keyboard shortcuts). | 55 // through keyboard layouts via keyboard shortcuts). |
56 scoped_ptr<base::ListValue> GetLoginKeyboardLayouts( | 56 scoped_ptr<base::ListValue> GetAndActivateLoginKeyboardLayouts( |
57 const std::string& locale, | 57 const std::string& locale, |
58 const std::string& selected); | 58 const std::string& selected); |
59 | 59 |
60 // Invokes |callback| with a list of keyboard layouts that can be used for | 60 // Invokes |callback| with a list of keyboard layouts that can be used for |
61 // |locale|. Each list entry is a dictionary that contains data such as an ID | 61 // |locale|. Each list entry is a dictionary that contains data such as an ID |
62 // and a display name. The list will consist of the device's hardware layouts, | 62 // and a display name. The list will consist of the device's hardware layouts, |
63 // followed by a divider and locale-specific keyboard layouts, if any. All | 63 // followed by a divider and locale-specific keyboard layouts, if any. All |
64 // layouts supported for |locale| are returned, including those that produce | 64 // layouts supported for |locale| are returned, including those that produce |
65 // non-Latin characters by default. | 65 // non-Latin characters by default. |
66 typedef base::Callback<void(scoped_ptr<base::ListValue>)> | 66 typedef base::Callback<void(scoped_ptr<base::ListValue>)> |
67 GetKeyboardLayoutsForLocaleCallback; | 67 GetKeyboardLayoutsForLocaleCallback; |
68 void GetKeyboardLayoutsForLocale( | 68 void GetKeyboardLayoutsForLocale( |
69 const GetKeyboardLayoutsForLocaleCallback& callback, | 69 const GetKeyboardLayoutsForLocaleCallback& callback, |
70 const std::string& locale); | 70 const std::string& locale); |
71 | 71 |
72 // Returns the current keyboard layout, expressed as a dictionary that contains | 72 // Returns the current keyboard layout, expressed as a dictionary that contains |
73 // data such as an ID and a display name. | 73 // data such as an ID and a display name. |
74 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout(); | 74 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout(); |
75 | 75 |
76 } // namespace chromeos | 76 } // namespace chromeos |
77 | 77 |
78 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ | 78 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ |
OLD | NEW |