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)); |
} |