[email protected] | f786717 | 2012-07-11 07:04:07 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | c6d068ff | 2011-10-14 17:28:23 | [diff] [blame] | 5 | #ifndef CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ |
6 | #define CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ | ||||
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 7 | |
8 | #include <windows.h> | ||||
9 | |||||
10 | #include <string> | ||||
[email protected] | 9db40b68 | 2009-05-29 00:39:59 | [diff] [blame] | 11 | #include <vector> |
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 12 | #include "base/basictypes.h" |
13 | |||||
[email protected] | 2dbcad1c | 2012-10-30 00:20:09 | [diff] [blame] | 14 | namespace content { |
15 | |||||
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 16 | // Implements the platform-dependent part of a pseudo keyboard device for |
17 | // Windows. | ||||
18 | class MockKeyboardDriverWin { | ||||
19 | public: | ||||
20 | MockKeyboardDriverWin(); | ||||
21 | ~MockKeyboardDriverWin(); | ||||
22 | |||||
23 | bool SetLayout(int layout); | ||||
24 | bool SetModifiers(int modifiers); | ||||
25 | int GetCharacters(int key_code, std::wstring* code); | ||||
26 | |||||
27 | private: | ||||
[email protected] | 9db40b68 | 2009-05-29 00:39:59 | [diff] [blame] | 28 | void MaybeUnloadActiveLayout(); |
29 | |||||
30 | // The list of keyboard drivers that are installed on this machine. | ||||
31 | std::vector<HKL> orig_keyboard_layouts_list_; | ||||
32 | // The active keyboard driver at the time the Ctor was called. | ||||
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 33 | HKL original_keyboard_layout_; |
[email protected] | 9db40b68 | 2009-05-29 00:39:59 | [diff] [blame] | 34 | // The currently active driver. |
35 | HKL active_keyboard_layout_; | ||||
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 36 | BYTE original_keyboard_states_[256]; |
37 | |||||
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 38 | BYTE keyboard_states_[256]; |
39 | |||||
40 | DISALLOW_COPY_AND_ASSIGN(MockKeyboardDriverWin); | ||||
41 | }; | ||||
42 | |||||
[email protected] | 2dbcad1c | 2012-10-30 00:20:09 | [diff] [blame] | 43 | } // namespace content |
44 | |||||
[email protected] | c6d068ff | 2011-10-14 17:28:23 | [diff] [blame] | 45 | #endif // CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ |