OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 UI_KEYBOARD_KEYBOARD_UTIL_H_ | 5 #ifndef UI_KEYBOARD_KEYBOARD_UTIL_H_ |
6 #define UI_KEYBOARD_KEYBOARD_UTIL_H_ | 6 #define UI_KEYBOARD_KEYBOARD_UTIL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "ui/keyboard/keyboard_export.h" | 10 #include "ui/keyboard/keyboard_export.h" |
9 | 11 |
| 12 namespace base { |
| 13 class ListValue; |
| 14 } |
| 15 |
| 16 namespace ui { |
| 17 class KeyEvent; |
| 18 } |
| 19 |
10 namespace keyboard { | 20 namespace keyboard { |
11 | 21 |
12 // Returns true if the virtual keyboard is enabled. | 22 // Returns true if the virtual keyboard is enabled. |
13 KEYBOARD_EXPORT bool IsKeyboardEnabled(); | 23 KEYBOARD_EXPORT bool IsKeyboardEnabled(); |
14 | 24 |
| 25 // Creates a ui::KeyEvent from the argument base::ListValue that is passed to |
| 26 // the synthetic input APIs (either the Extension API or the WebUI API). The |
| 27 // returned ui::KeyEvent is owned by the caller. If an error occurs, NULL is |
| 28 // returned and |error| will be populated with a description of the error. For |
| 29 // a description of the expected input, please see |
| 30 // chrome/common/extensions/api/experimental_input_virtual_keyboard.json |
| 31 KEYBOARD_EXPORT ui::KeyEvent* KeyEventFromArgs(const base::ListValue* args, |
| 32 std::string* error); |
| 33 |
15 } // namespace keyboard | 34 } // namespace keyboard |
16 | 35 |
17 #endif // UI_KEYBOARD_KEYBOARD_UTIL_H_ | 36 #endif // UI_KEYBOARD_KEYBOARD_UTIL_H_ |
OLD | NEW |