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 #include "chrome/test/chromedriver/keycode_text_conversion.h" | 5 #include "chrome/test/chromedriver/keycode_text_conversion.h" |
6 | 6 |
7 #import <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
8 | 8 |
9 #include <cctype> | 9 #include <cctype> |
10 | 10 |
11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/test/chromedriver/ui_events.h" | 13 #include "chrome/test/chromedriver/chrome/ui_events.h" |
14 #include "ui/base/keycodes/keyboard_code_conversion_mac.h" | 14 #include "ui/base/keycodes/keyboard_code_conversion_mac.h" |
15 | 15 |
16 std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) { | 16 std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) { |
17 int mac_key_code = 0; | 17 int mac_key_code = 0; |
18 { | 18 { |
19 unichar character, unmodified_character; | 19 unichar character, unmodified_character; |
20 mac_key_code = ui::MacKeyCodeForWindowsKeyCode( | 20 mac_key_code = ui::MacKeyCodeForWindowsKeyCode( |
21 key_code, | 21 key_code, |
22 0, | 22 0, |
23 &character, | 23 &character, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 *necessary_modifiers = kShiftKeyModifierMask; | 89 *necessary_modifiers = kShiftKeyModifierMask; |
90 found_code = true; | 90 found_code = true; |
91 } | 91 } |
92 if (found_code) { | 92 if (found_code) { |
93 *key_code = code; | 93 *key_code = code; |
94 break; | 94 break; |
95 } | 95 } |
96 } | 96 } |
97 return found_code; | 97 return found_code; |
98 } | 98 } |
OLD | NEW |