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

Unified Diff: ui/base/ime/input_method_base.cc

Issue 2077783002: Make limitations for input.ime.sendKeyEvents API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chromeos error. Created 4 years, 6 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
« no previous file with comments | « ui/base/ime/input_method_base.h ('k') | ui/base/ime/mock_input_method.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_base.cc
diff --git a/ui/base/ime/input_method_base.cc b/ui/base/ime/input_method_base.cc
index 282b6c4f9ad5434ab6eef5d541eea02a8245d12b..9a37f8dfde652adc7b930b5d823687e6c3fcb79d 100644
--- a/ui/base/ime/input_method_base.cc
+++ b/ui/base/ime/input_method_base.cc
@@ -199,8 +199,21 @@ void InputMethodBase::DeleteSurroundingText(int32_t offset, uint32_t length) {}
void InputMethodBase::SendKeyEvent(KeyEvent* event) {
sending_key_event_ = true;
+ if (track_key_events_for_testing_) {
+ key_events_for_testing_.push_back(
+ std::unique_ptr<ui::KeyEvent>(new KeyEvent(*event)));
+ }
DispatchKeyEvent(event);
sending_key_event_ = false;
}
+InputMethod* InputMethodBase::GetInputMethod() {
+ return this;
+}
+
+const std::vector<std::unique_ptr<ui::KeyEvent>>&
+InputMethodBase::GetKeyEventsForTesting() {
+ return key_events_for_testing_;
+}
+
} // namespace ui
« no previous file with comments | « ui/base/ime/input_method_base.h ('k') | ui/base/ime/mock_input_method.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698