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 #include "content/test/mock_keyboard_driver_win.h" | 5 #include "content/test/mock_keyboard_driver_win.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include <stddef.h> |
| 8 #include <string.h> |
| 9 |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/macros.h" |
9 #include "content/test/mock_keyboard.h" | 12 #include "content/test/mock_keyboard.h" |
10 | 13 |
11 namespace content { | 14 namespace content { |
12 | 15 |
13 MockKeyboardDriverWin::MockKeyboardDriverWin() { | 16 MockKeyboardDriverWin::MockKeyboardDriverWin() { |
14 // Save the keyboard layout and status of the application. | 17 // Save the keyboard layout and status of the application. |
15 // This class changes the keyboard layout and status of this application. | 18 // This class changes the keyboard layout and status of this application. |
16 // This change may break succeeding tests. To prevent this possible break, we | 19 // This change may break succeeding tests. To prevent this possible break, we |
17 // should save the layout and status here to restore when this instance is | 20 // should save the layout and status here to restore when this instance is |
18 // destroyed. | 21 // destroyed. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 wchar_t code[16]; | 161 wchar_t code[16]; |
159 int length = ToUnicodeEx(key_code, MapVirtualKey(key_code, 0), | 162 int length = ToUnicodeEx(key_code, MapVirtualKey(key_code, 0), |
160 &keyboard_states_[0], &code[0], arraysize(code), 0, | 163 &keyboard_states_[0], &code[0], arraysize(code), 0, |
161 active_keyboard_layout_); | 164 active_keyboard_layout_); |
162 if (length > 0) | 165 if (length > 0) |
163 output->assign(code); | 166 output->assign(code); |
164 return length; | 167 return length; |
165 } | 168 } |
166 | 169 |
167 } // namespace content | 170 } // namespace content |
OLD | NEW |