Index: content/test/mock_keyboard.cc |
diff --git a/content/test/mock_keyboard.cc b/content/test/mock_keyboard.cc |
index 55b695d44d50c63ddeec3a695ab55f1ff1b27383..d082e9f13fd708ff8bcad0dbce1c36114567be3a 100644 |
--- a/content/test/mock_keyboard.cc |
+++ b/content/test/mock_keyboard.cc |
@@ -16,30 +16,34 @@ MockKeyboard::MockKeyboard() |
MockKeyboard::~MockKeyboard() { |
} |
-int MockKeyboard::GetCharacters(Layout layout, |
- int key_code, |
- Modifiers modifiers, |
- std::wstring* output) { |
-#if defined(OS_WIN) |
- CHECK(output); |
+bool MockKeyboard::Update(Layout layout, Modifiers modifiers) { |
// Change the keyboard layout only when we have to because it takes a lot of |
// time to load a keyboard-layout driver. |
// When we change the layout, we reset the modifier status to force updating |
// the keyboard status. |
if (layout != keyboard_layout_) { |
+#if defined(OS_WIN) |
if (!driver_.SetLayout(layout)) |
- return -1; |
+ return false; |
+#endif |
keyboard_layout_ = layout; |
keyboard_modifiers_ = INVALID; |
} |
// Update the keyboard states. |
if (modifiers != keyboard_modifiers_) { |
- if (!driver_.SetModifiers(modifiers)) |
- return -1; |
+#if defined(OS_WIN) |
+ driver_.SetModifiers(modifiers); |
+#endif |
keyboard_modifiers_ = modifiers; |
} |
+ return true; |
+} |
+ |
+int MockKeyboard::GetCharacters(int key_code, std::wstring* output) const { |
+#if defined(OS_WIN) |
+ CHECK(output); |
// Retrieve Unicode characters associate with the key code. |
return driver_.GetCharacters(key_code, output); |
#else |