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

Unified Diff: content/browser/renderer_host/ime_adapter_android.cc

Issue 2323983003: DO NOT SUBMIT: Bundle IME-related messages into one for batch edit (Closed)
Patch Set: fixed nits and fixed blimp test Created 4 years, 3 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: content/browser/renderer_host/ime_adapter_android.cc
diff --git a/content/browser/renderer_host/ime_adapter_android.cc b/content/browser/renderer_host/ime_adapter_android.cc
index 98048d1b26f7ce91f37d69ed4443f1d9172fe5f6..523ad2273fe2ae4f876d25d20260296689c146ae 100644
--- a/content/browser/renderer_host/ime_adapter_android.cc
+++ b/content/browser/renderer_host/ime_adapter_android.cc
@@ -218,17 +218,33 @@ void ImeAdapterAndroid::FocusedNodeChanged(bool is_editable_node) {
}
}
+void ImeAdapterAndroid::BeginBatchEdit(JNIEnv*, const JavaParamRef<jobject>&) {
+ RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
+ if (!rwhi)
+ return;
+
+ rwhi->BeginBatchEdit();
+}
+
+void ImeAdapterAndroid::EndBatchEdit(JNIEnv*, const JavaParamRef<jobject>&) {
+ RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
+ if (!rwhi)
+ return;
+
+ rwhi->EndBatchEdit();
+}
+
void ImeAdapterAndroid::SetEditableSelectionOffsets(
JNIEnv*,
const JavaParamRef<jobject>&,
int start,
int end) {
- RenderFrameHost* rfh = GetFocusedFrame();
- if (!rfh)
+ RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
+ if (!rwhi)
return;
- rfh->Send(new InputMsg_SetEditableSelectionOffsets(rfh->GetRoutingID(), start,
- end));
+ rwhi->SendOrBatch(new InputMsg_ImeSetEditableSelectionOffsets(
+ rwhi->GetRoutingID(), start, end));
}
void ImeAdapterAndroid::SetCharacterBounds(
@@ -257,26 +273,26 @@ void ImeAdapterAndroid::SetComposingRegion(JNIEnv*,
const JavaParamRef<jobject>&,
int start,
int end) {
- RenderFrameHost* rfh = GetFocusedFrame();
- if (!rfh)
+ RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
+ if (!rwhi)
return;
std::vector<blink::WebCompositionUnderline> underlines;
underlines.push_back(blink::WebCompositionUnderline(
0, end - start, SK_ColorBLACK, false, SK_ColorTRANSPARENT));
- rfh->Send(new InputMsg_SetCompositionFromExistingText(
- rfh->GetRoutingID(), start, end, underlines));
+ rwhi->SendOrBatch(new InputMsg_ImeSetCompositionFromExistingText(
+ rwhi->GetRoutingID(), start, end, underlines));
}
void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*,
const JavaParamRef<jobject>&,
int before,
int after) {
- RenderFrameHostImpl* rfh =
- static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
- if (rfh)
- rfh->ExtendSelectionAndDelete(before, after);
+ RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
+ if (!rwhi)
+ return;
+ rwhi->ExtendSelectionAndDelete(before, after);
}
bool ImeAdapterAndroid::RequestTextInputStateUpdate(
@@ -285,7 +301,7 @@ bool ImeAdapterAndroid::RequestTextInputStateUpdate(
RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
if (!rwhi)
return false;
- rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID()));
+ rwhi->Send(new InputMsg_ImeRequestTextInputStateUpdate(rwhi->GetRoutingID()));
return true;
}
@@ -297,7 +313,7 @@ void ImeAdapterAndroid::RequestCursorUpdate(
RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
if (!rwhi)
return;
- rwhi->Send(new InputMsg_RequestCompositionUpdate(
+ rwhi->Send(new InputMsg_ImeRequestCompositionUpdate(
rwhi->GetRoutingID(), immediate_request, monitor_request));
}
« no previous file with comments | « content/browser/renderer_host/ime_adapter_android.h ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698