[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / test / mock_keyboard_driver_win.h
blob15150dd62fa972b40c98dc2aaa6a68fa32e0597e
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_
6 #define CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_
8 #include <windows.h>
10 #include <string>
11 #include <vector>
12 #include "base/basictypes.h"
14 namespace content {
16 // Implements the platform-dependent part of a pseudo keyboard device for
17 // Windows.
18 class MockKeyboardDriverWin {
19 public:
20 MockKeyboardDriverWin();
21 ~MockKeyboardDriverWin();
23 bool SetLayout(int layout);
24 bool SetModifiers(int modifiers);
25 int GetCharacters(int key_code, std::wstring* code);
27 private:
28 void MaybeUnloadActiveLayout();
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.
33 HKL original_keyboard_layout_;
34 // The currently active driver.
35 HKL active_keyboard_layout_;
36 BYTE original_keyboard_states_[256];
38 BYTE keyboard_states_[256];
40 DISALLOW_COPY_AND_ASSIGN(MockKeyboardDriverWin);
43 } // namespace content
45 #endif // CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_