diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-14 17:28:23 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-14 17:28:23 +0000 |
commit | c6d068ff599527ce4fccd39fd593099aada24d67 (patch) | |
tree | 5923cd9a4583780ce8d3384c24ec1a972156add9 /content/test/mock_keyboard_driver_win.h | |
parent | 595bfa8b392c172ff1b70c0d329d2bc1102ec242 (diff) | |
download | chromium_src-c6d068ff599527ce4fccd39fd593099aada24d67.zip chromium_src-c6d068ff599527ce4fccd39fd593099aada24d67.tar.gz chromium_src-c6d068ff599527ce4fccd39fd593099aada24d67.tar.bz2 |
Split most of RenderViewTest and associated classes into content.
BUG=99224
TEST=existing browser_tests, unit_tests
Review URL: http://codereview.chromium.org/8230034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/mock_keyboard_driver_win.h')
-rw-r--r-- | content/test/mock_keyboard_driver_win.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/content/test/mock_keyboard_driver_win.h b/content/test/mock_keyboard_driver_win.h new file mode 100644 index 0000000..44c2b2d --- /dev/null +++ b/content/test/mock_keyboard_driver_win.h @@ -0,0 +1,42 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ +#define CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ +#pragma once + +#include <windows.h> + +#include <string> +#include <vector> +#include "base/basictypes.h" + +// Implements the platform-dependent part of a pseudo keyboard device for +// Windows. +class MockKeyboardDriverWin { + public: + MockKeyboardDriverWin(); + ~MockKeyboardDriverWin(); + + bool SetLayout(int layout); + bool SetModifiers(int modifiers); + int GetCharacters(int key_code, std::wstring* code); + + private: + void MaybeUnloadActiveLayout(); + + // The list of keyboard drivers that are installed on this machine. + std::vector<HKL> orig_keyboard_layouts_list_; + // The active keyboard driver at the time the Ctor was called. + HKL original_keyboard_layout_; + // The currently active driver. + HKL active_keyboard_layout_; + BYTE original_keyboard_states_[256]; + + BYTE keyboard_states_[256]; + + DISALLOW_COPY_AND_ASSIGN(MockKeyboardDriverWin); +}; + +#endif // CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ |