| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 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. | |
| 4 | |
| 5 #ifndef CHROME_RENDERER_MOCK_KEYBOARD_DRIVER_WIN_H_ | |
| 6 #define CHROME_RENDERER_MOCK_KEYBOARD_DRIVER_WIN_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <windows.h> | |
| 10 | |
| 11 #include <string> | |
| 12 #include <vector> | |
| 13 #include "base/basictypes.h" | |
| 14 | |
| 15 // Implements the platform-dependent part of a pseudo keyboard device for | |
| 16 // Windows. | |
| 17 class MockKeyboardDriverWin { | |
| 18 public: | |
| 19 MockKeyboardDriverWin(); | |
| 20 ~MockKeyboardDriverWin(); | |
| 21 | |
| 22 bool SetLayout(int layout); | |
| 23 bool SetModifiers(int modifiers); | |
| 24 int GetCharacters(int key_code, std::wstring* code); | |
| 25 | |
| 26 private: | |
| 27 void MaybeUnloadActiveLayout(); | |
| 28 | |
| 29 // The list of keyboard drivers that are installed on this machine. | |
| 30 std::vector<HKL> orig_keyboard_layouts_list_; | |
| 31 // The active keyboard driver at the time the Ctor was called. | |
| 32 HKL original_keyboard_layout_; | |
| 33 // The currently active driver. | |
| 34 HKL active_keyboard_layout_; | |
| 35 BYTE original_keyboard_states_[256]; | |
| 36 | |
| 37 BYTE keyboard_states_[256]; | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(MockKeyboardDriverWin); | |
| 40 }; | |
| 41 | |
| 42 #endif // CHROME_RENDERER_MOCK_KEYBOARD_DRIVER_WIN_H_ | |
| OLD | NEW |