Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1679)

Unified Diff: content/test/mock_keyboard.cc

Issue 1026493002: Allow only a user gesture to trigger autofill popup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not show autofill popup if desktop IME is composing. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698