OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TEST_WEBDRIVER_KEYCODE_TEXT_CONVERSION_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_KEYCODE_TEXT_CONVERSION_H_ |
6 #define CHROME_TEST_WEBDRIVER_KEYCODE_TEXT_CONVERSION_H_ | 6 #define CHROME_TEST_WEBDRIVER_KEYCODE_TEXT_CONVERSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "ui/base/keycodes/keyboard_codes.h" | 11 #include "ui/base/keycodes/keyboard_codes.h" |
12 | 12 |
13 namespace webdriver { | 13 namespace webdriver { |
14 | 14 |
15 // These functions only support conversion of characters in the BMP | 15 // These functions only support conversion of characters in the BMP |
16 // (Basic Multilingual Plane). | 16 // (Basic Multilingual Plane). |
17 | 17 |
18 // Returns the text in UTF8 that would be produced from the given key code and | 18 // Returns the text in UTF8 that would be produced from the given key code and |
19 // modifiers with the current keyboard layout, or "" if no character would | 19 // modifiers with the current keyboard layout, or "" if no character would |
20 // be produced. This will return "" if the produced text contains characters | 20 // be produced. This will return "" if the produced text contains characters |
21 // outside the BMP. | 21 // outside the BMP. |
22 std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers); | 22 std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers); |
23 | 23 |
24 // Converts a character to the key code and modifiers that would produce | 24 // Converts a character to the key code and modifiers that would produce |
25 // the character using the current keyboard layout. Returns true on success. | 25 // the character using the current keyboard layout. Returns true on success. |
26 bool ConvertCharToKeyCode( | 26 bool ConvertCharToKeyCode( |
27 char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers); | 27 char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers); |
28 | 28 |
29 } // namespace webdriver | 29 } // namespace webdriver |
30 | 30 |
31 #endif // CHROME_TEST_WEBDRIVER_KEYCODE_TEXT_CONVERSION_H_ | 31 #endif // CHROME_TEST_WEBDRIVER_KEYCODE_TEXT_CONVERSION_H_ |
OLD | NEW |