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

Unified Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

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/chromeos/input_method/input_method_engine.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc
index b9859db24ba612f3b8ff8ceced68b4a4a5083536..370852f1ac4c1064f69de27f07c557de7208e6a5 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine.cc
@@ -344,4 +344,28 @@ void InputMethodEngine::MenuItemToProperty(
// TODO(nona): Support item.children.
}
+void InputMethodEngine::UpdateComposition(
+ const ui::CompositionText& composition_text,
+ uint32_t cursor_pos,
+ bool is_visible) {
+ ui::IMEInputContextHandlerInterface* input_context =
+ ui::IMEBridge::Get()->GetInputContextHandler();
+ if (input_context)
+ input_context->UpdateCompositionText(composition_text, cursor_pos,
+ is_visible);
+}
+
+void InputMethodEngine::CommitTextToInputContext(int context_id,
+ const std::string& text) {
+ ui::IMEBridge::Get()->GetInputContextHandler()->CommitText(text);
+
+ // Records histograms for committed characters.
+ if (!composition_text_->text.empty()) {
+ base::string16 wtext = base::UTF8ToUTF16(text);
+ UMA_HISTOGRAM_CUSTOM_COUNTS("InputMethod.CommitLength", wtext.length(), 1,
+ 25, 25);
+ composition_text_.reset(new ui::CompositionText());
+ }
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_engine.h ('k') | chrome/browser/extensions/api/input_ime/input_ime_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698