This source file includes following definitions.
- keyboard_modifiers_
- GetCharacters
#include "content/test/mock_keyboard.h"
#include "base/logging.h"
namespace content {
MockKeyboard::MockKeyboard()
: keyboard_layout_(LAYOUT_NULL),
keyboard_modifiers_(INVALID) {
}
MockKeyboard::~MockKeyboard() {
}
int MockKeyboard::GetCharacters(Layout layout,
int key_code,
Modifiers modifiers,
std::wstring* output) {
#if defined(OS_WIN)
CHECK(output);
if (layout != keyboard_layout_) {
if (!driver_.SetLayout(layout))
return -1;
keyboard_layout_ = layout;
keyboard_modifiers_ = INVALID;
}
if (modifiers != keyboard_modifiers_) {
if (!driver_.SetModifiers(modifiers))
return -1;
keyboard_modifiers_ = modifiers;
}
return driver_.GetCharacters(key_code, output);
#else
NOTIMPLEMENTED();
return -1;
#endif
}
}