| OLD | NEW |
| 1 // Copyright (c) 2010 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 "chrome/renderer/mock_keyboard_driver_win.h" | 5 #include "content/test/mock_keyboard_driver_win.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/renderer/mock_keyboard.h" | 9 #include "content/test/mock_keyboard.h" |
| 10 | 10 |
| 11 MockKeyboardDriverWin::MockKeyboardDriverWin() { | 11 MockKeyboardDriverWin::MockKeyboardDriverWin() { |
| 12 // Save the keyboard layout and status of the application. | 12 // Save the keyboard layout and status of the application. |
| 13 // This class changes the keyboard layout and status of this application. | 13 // This class changes the keyboard layout and status of this application. |
| 14 // This change may break succeeding tests. To prevent this possible break, we | 14 // This change may break succeeding tests. To prevent this possible break, we |
| 15 // should save the layout and status here to restore when this instance is | 15 // should save the layout and status here to restore when this instance is |
| 16 // destroyed. | 16 // destroyed. |
| 17 original_keyboard_layout_ = GetKeyboardLayout(0); | 17 original_keyboard_layout_ = GetKeyboardLayout(0); |
| 18 active_keyboard_layout_ = original_keyboard_layout_; | 18 active_keyboard_layout_ = original_keyboard_layout_; |
| 19 GetKeyboardState(&original_keyboard_states_[0]); | 19 GetKeyboardState(&original_keyboard_states_[0]); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // the mofifiers. | 154 // the mofifiers. |
| 155 CHECK(output); | 155 CHECK(output); |
| 156 wchar_t code[16]; | 156 wchar_t code[16]; |
| 157 int length = ToUnicodeEx(key_code, MapVirtualKey(key_code, 0), | 157 int length = ToUnicodeEx(key_code, MapVirtualKey(key_code, 0), |
| 158 &keyboard_states_[0], &code[0], arraysize(code), 0, | 158 &keyboard_states_[0], &code[0], arraysize(code), 0, |
| 159 active_keyboard_layout_); | 159 active_keyboard_layout_); |
| 160 if (length > 0) | 160 if (length > 0) |
| 161 output->assign(code); | 161 output->assign(code); |
| 162 return length; | 162 return length; |
| 163 } | 163 } |
| OLD | NEW |