Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/l10n_util.h

Issue 417103003: Retrieve the list of keyboard layouts for public sessions async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use blocking pool instead of FILE thread. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
11 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 13
13 namespace base { 14 namespace base {
15 class DictionaryValue;
14 class ListValue; 16 class ListValue;
15 } 17 }
16 18
17 namespace chromeos { 19 namespace chromeos {
18 20
19 // GetUILanguageList() returns a concatenated list of the most relevant 21 // GetUILanguageList() returns a concatenated list of the most relevant
20 // languages followed by all others. An entry with its "code" attribute set to 22 // languages followed by all others. An entry with its "code" attribute set to
21 // this value is inserted in between. 23 // this value is inserted in between.
22 extern const char kMostRelevantLanguagesDivider[]; 24 extern const char kMostRelevantLanguagesDivider[];
23 25
(...skipping 24 matching lines...) Expand all
48 // 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
49 // 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
50 // 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.
51 // 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
52 // 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
53 // through keyboard layouts via keyboard shortcuts). 55 // through keyboard layouts via keyboard shortcuts).
54 scoped_ptr<base::ListValue> GetLoginKeyboardLayouts( 56 scoped_ptr<base::ListValue> GetLoginKeyboardLayouts(
55 const std::string& locale, 57 const std::string& locale,
56 const std::string& selected); 58 const std::string& selected);
57 59
58 // Return a list of keyboard layouts that can be used for |locale|. Each list 60 // Invokes |callback| with a list of keyboard layouts that can be used for
59 // entry is a dictionary that contains data such as an ID and a display name. 61 // |locale|. Each list entry is a dictionary that contains data such as an ID
60 // The list will consist of the device's hardware layouts, followed by a divider 62 // and a display name. The list will consist of the device's hardware layouts,
61 // and locale-specific keyboard layouts, if any. All layouts supported for 63 // followed by a divider and locale-specific keyboard layouts, if any. All
62 // |locale| are returned, including those that produce non-Latin characters by 64 // layouts supported for |locale| are returned, including those that produce
63 // default. 65 // non-Latin characters by default.
64 scoped_ptr<base::ListValue> GetKeyboardLayoutsForLocale( 66 typedef base::Callback<void(scoped_ptr<base::ListValue>)>
67 GetKeyboardLayoutsForLocaleCallback;
68 void GetKeyboardLayoutsForLocale(
69 const GetKeyboardLayoutsForLocaleCallback& callback,
65 const std::string& locale); 70 const std::string& locale);
66 71
72 // Returns the current keyboard layout, expressed as a dictionary that contains
73 // data such as an ID and a display name.
74 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout();
75
67 } // namespace chromeos 76 } // namespace chromeos
68 77
69 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_ 78 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_L10N_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screens/user_selection_screen.cc ('k') | chrome/browser/ui/webui/chromeos/login/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698