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

Unified Diff: ui/base/ime/input_method.h

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/ime_input_context_handler_interface.h ('k') | ui/base/ime/input_method_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method.h
diff --git a/ui/base/ime/input_method.h b/ui/base/ime/input_method.h
index 598fd4f76f9824db98e3b0d60631a3e1da85c930..cfa5583192520437d31f190346e3ced9c8a9192e 100644
--- a/ui/base/ime/input_method.h
+++ b/ui/base/ime/input_method.h
@@ -8,12 +8,18 @@
#include <stdint.h>
#include <string>
+#include <vector>
#include "base/event_types.h"
+#include "base/memory/scoped_vector.h"
#include "build/build_config.h"
#include "ui/base/ime/text_input_mode.h"
#include "ui/base/ime/text_input_type.h"
+namespace extensions {
+class InputImeApiTest;
+} // namespace extensions
+
namespace ui {
namespace internal {
@@ -48,6 +54,7 @@ class TextInputClient;
// ui::InputMethod and owns it.
class InputMethod {
public:
+ InputMethod() : track_key_events_for_testing_(false) {}
#if defined(OS_WIN)
typedef LRESULT NativeEventResult;
@@ -152,6 +159,16 @@ class InputMethod {
// Management of the observer list.
virtual void AddObserver(InputMethodObserver* observer) = 0;
virtual void RemoveObserver(InputMethodObserver* observer) = 0;
+
+ protected:
+ friend class extensions::InputImeApiTest;
+
+ // Gets the tracked key events of using input.ime.sendKeyEvents API.
+ virtual const std::vector<std::unique_ptr<ui::KeyEvent>>&
+ GetKeyEventsForTesting() = 0;
+
+ // Whether the key events will be tracked. Only used for testing.
+ bool track_key_events_for_testing_;
};
} // namespace ui
« no previous file with comments | « ui/base/ime/ime_input_context_handler_interface.h ('k') | ui/base/ime/input_method_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698