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

Unified Diff: components/arc/ime/arc_ime_bridge_impl.cc

Issue 2136933002: Add ime.ExtendSelectionAndDelete Mojo RPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ime.ExtendSelectionAndDelete Mojo RPC Created 4 years, 5 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 | « components/arc/ime/arc_ime_bridge_impl.h ('k') | components/arc/ime/arc_ime_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/ime/arc_ime_bridge_impl.cc
diff --git a/components/arc/ime/arc_ime_bridge_impl.cc b/components/arc/ime/arc_ime_bridge_impl.cc
index 6b375d9c49776d18d7362f0ed758f568ef8ef255..b575a4a8df12c368442f7f795873046eb2cc7b6c 100644
--- a/components/arc/ime/arc_ime_bridge_impl.cc
+++ b/components/arc/ime/arc_ime_bridge_impl.cc
@@ -15,6 +15,7 @@ namespace arc {
namespace {
constexpr int kMinVersionForOnKeyboardsBoundsChanging = 3;
+constexpr int kMinVersionForExtendSelectionAndDelete = 4;
ui::TextInputType ConvertTextInputType(arc::mojom::TextInputType ipc_type) {
// The two enum types are similar, but intentionally made not identical.
@@ -135,6 +136,22 @@ void ArcImeBridgeImpl::SendOnKeyboardBoundsChanging(
ime_instance->OnKeyboardBoundsChanging(new_bounds);
}
+void ArcImeBridgeImpl::SendExtendSelectionAndDelete(
+ size_t before, size_t after) {
+ mojom::ImeInstance* ime_instance = bridge_service_->ime_instance();
+ if (!ime_instance) {
+ LOG(ERROR) << "ArcImeInstance method called before being ready.";
+ return;
+ }
+ if (bridge_service_->ime_version() <
+ kMinVersionForExtendSelectionAndDelete) {
+ LOG(ERROR) << "ArcImeInstance is too old for ExtendSelectionAndDelete.";
+ return;
+ }
+
+ ime_instance->ExtendSelectionAndDelete(before, after);
+}
+
void ArcImeBridgeImpl::OnTextInputTypeChanged(arc::mojom::TextInputType type) {
delegate_->OnTextInputTypeChanged(ConvertTextInputType(type));
}
« no previous file with comments | « components/arc/ime/arc_ime_bridge_impl.h ('k') | components/arc/ime/arc_ime_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698