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

Unified Diff: chrome/browser/ui/input_method/input_method_engine_base.h

Issue 1657593007: Implement chrome.input.ime.setComposition/commitText API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use Xxx::Results::Create(). Created 4 years, 10 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: chrome/browser/ui/input_method/input_method_engine_base.h
diff --git a/chrome/browser/ui/input_method/input_method_engine_base.h b/chrome/browser/ui/input_method/input_method_engine_base.h
index 6014931f4402205697531aec05df2555385c0195..1ca4a1620fb024d3bc189230e01c677ea323bae4 100644
--- a/chrome/browser/ui/input_method/input_method_engine_base.h
+++ b/chrome/browser/ui/input_method/input_method_engine_base.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/time/time.h"
#include "ui/base/ime/chromeos/input_method_descriptor.h"
+#include "ui/base/ime/composition_text.h"
#include "ui/base/ime/ime_engine_handler_interface.h"
#include "url/gurl.h"
@@ -174,7 +175,18 @@ class InputMethodEngineBase : virtual public ui::IMEEngineHandlerInterface {
const std::string& component_id,
ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data);
+ // Called when a key event is handled.
+ void KeyEventHandled();
+
protected:
+ // Notifies InputContextHandler that the composition is changed.
+ virtual void UpdateComposition(const ui::CompositionText& composition_text,
+ uint32_t cursor_pos,
+ bool is_visible) = 0;
+ // Notifies InputContextHanlder to commit |text|.
+ virtual void CommitTextToInputContext(int context_id,
+ const std::string& text) = 0;
+
ui::TextInputType current_input_type_;
// ID that is used for the current input context. False if there is no focus.
@@ -209,6 +221,16 @@ class InputMethodEngineBase : virtual public ui::IMEEngineHandlerInterface {
unsigned int next_request_id_;
RequestMap request_map_;
+
+ // The composition text to be set from calling input.ime.setComposition API.
+ ui::CompositionText composition_;
+
+ // The text to be committed from calling input.ime.commitText API.
+ std::string text_;
+
+ // Indicates whether the IME extension is currently handling a physical key
+ // event. This is used in CommitText/UpdateCompositionText/etc.
+ bool handling_key_event_;
};
} // namespace input_method
« no previous file with comments | « chrome/browser/ui/input_method/input_method_engine.cc ('k') | chrome/browser/ui/input_method/input_method_engine_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698