| 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 7fe848513e3533ff3fcbb84ed70823ab3ed0d7db..d70d4969d2ed28d4e424fb372cd512d94019e2a7 100644
|
| --- a/content/browser/renderer_host/ime_adapter_android.cc
|
| +++ b/content/browser/renderer_host/ime_adapter_android.cc
|
| @@ -124,7 +124,7 @@ ImeAdapterAndroid::~ImeAdapterAndroid() {
|
| }
|
|
|
| bool ImeAdapterAndroid::SendSyntheticKeyEvent(JNIEnv*,
|
| - jobject,
|
| + const JavaParamRef<jobject>&,
|
| int type,
|
| long time_ms,
|
| int key_code,
|
| @@ -137,12 +137,17 @@ bool ImeAdapterAndroid::SendSyntheticKeyEvent(JNIEnv*,
|
| return true;
|
| }
|
|
|
| -bool ImeAdapterAndroid::SendKeyEvent(JNIEnv* env, jobject,
|
| - jobject original_key_event,
|
| - int action, int modifiers,
|
| - long time_ms, int key_code,
|
| - int scan_code, bool is_system_key,
|
| - int unicode_char) {
|
| +bool ImeAdapterAndroid::SendKeyEvent(
|
| + JNIEnv* env,
|
| + const JavaParamRef<jobject>&,
|
| + const JavaParamRef<jobject>& original_key_event,
|
| + int action,
|
| + int modifiers,
|
| + long time_ms,
|
| + int key_code,
|
| + int scan_code,
|
| + bool is_system_key,
|
| + int unicode_char) {
|
| NativeWebKeyboardEvent event = NativeWebKeyboardEventFromKeyEvent(
|
| env, original_key_event, action, modifiers,
|
| time_ms, key_code, scan_code, is_system_key, unicode_char);
|
| @@ -167,9 +172,9 @@ bool ImeAdapterAndroid::SendKeyEvent(JNIEnv* env, jobject,
|
| }
|
|
|
| void ImeAdapterAndroid::SetComposingText(JNIEnv* env,
|
| - jobject obj,
|
| - jobject text,
|
| - jstring text_str,
|
| + const JavaParamRef<jobject>& obj,
|
| + const JavaParamRef<jobject>& text,
|
| + const JavaParamRef<jstring>& text_str,
|
| int new_cursor_pos) {
|
| RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
|
| if (!rwhi)
|
| @@ -201,7 +206,9 @@ void ImeAdapterAndroid::SetComposingText(JNIEnv* env,
|
| rwhi->ImeSetComposition(text16, underlines, new_cursor_pos, new_cursor_pos);
|
| }
|
|
|
| -void ImeAdapterAndroid::CommitText(JNIEnv* env, jobject, jstring text_str) {
|
| +void ImeAdapterAndroid::CommitText(JNIEnv* env,
|
| + const JavaParamRef<jobject>&,
|
| + const JavaParamRef<jstring>& text_str) {
|
| RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
|
| if (!rwhi)
|
| return;
|
| @@ -210,7 +217,8 @@ void ImeAdapterAndroid::CommitText(JNIEnv* env, jobject, jstring text_str) {
|
| rwhi->ImeConfirmComposition(text16, gfx::Range::InvalidRange(), false);
|
| }
|
|
|
| -void ImeAdapterAndroid::FinishComposingText(JNIEnv* env, jobject) {
|
| +void ImeAdapterAndroid::FinishComposingText(JNIEnv* env,
|
| + const JavaParamRef<jobject>&) {
|
| RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
|
| if (!rwhi)
|
| return;
|
| @@ -219,7 +227,9 @@ void ImeAdapterAndroid::FinishComposingText(JNIEnv* env, jobject) {
|
| true);
|
| }
|
|
|
| -void ImeAdapterAndroid::AttachImeAdapter(JNIEnv* env, jobject java_object) {
|
| +void ImeAdapterAndroid::AttachImeAdapter(
|
| + JNIEnv* env,
|
| + const JavaParamRef<jobject>& java_object) {
|
| java_ime_adapter_ = JavaObjectWeakGlobalRef(env, java_object);
|
| }
|
|
|
| @@ -240,8 +250,11 @@ void ImeAdapterAndroid::FocusedNodeChanged(bool is_editable_node) {
|
| }
|
| }
|
|
|
| -void ImeAdapterAndroid::SetEditableSelectionOffsets(JNIEnv*, jobject,
|
| - int start, int end) {
|
| +void ImeAdapterAndroid::SetEditableSelectionOffsets(
|
| + JNIEnv*,
|
| + const JavaParamRef<jobject>&,
|
| + int start,
|
| + int end) {
|
| RenderFrameHost* rfh = GetFocusedFrame();
|
| if (!rfh)
|
| return;
|
| @@ -250,8 +263,10 @@ void ImeAdapterAndroid::SetEditableSelectionOffsets(JNIEnv*, jobject,
|
| start, end));
|
| }
|
|
|
| -void ImeAdapterAndroid::SetComposingRegion(JNIEnv*, jobject,
|
| - int start, int end) {
|
| +void ImeAdapterAndroid::SetComposingRegion(JNIEnv*,
|
| + const JavaParamRef<jobject>&,
|
| + int start,
|
| + int end) {
|
| RenderFrameHost* rfh = GetFocusedFrame();
|
| if (!rfh)
|
| return;
|
| @@ -264,15 +279,18 @@ void ImeAdapterAndroid::SetComposingRegion(JNIEnv*, jobject,
|
| rfh->GetRoutingID(), start, end, underlines));
|
| }
|
|
|
| -void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, jobject,
|
| - int before, int after) {
|
| +void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*,
|
| + const JavaParamRef<jobject>&,
|
| + int before,
|
| + int after) {
|
| RenderFrameHostImpl* rfh =
|
| static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
|
| if (rfh)
|
| rfh->ExtendSelectionAndDelete(before, after);
|
| }
|
|
|
| -void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) {
|
| +void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env,
|
| + const JavaParamRef<jobject>&) {
|
| java_ime_adapter_.reset();
|
| }
|
|
|
|
|