OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 | 1184 |
1185 long ContentViewCoreImpl::GetNativeImeAdapter(JNIEnv* env, jobject obj) { | 1185 long ContentViewCoreImpl::GetNativeImeAdapter(JNIEnv* env, jobject obj) { |
1186 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | 1186 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
1187 if (!rwhva) | 1187 if (!rwhva) |
1188 return 0; | 1188 return 0; |
1189 return rwhva->GetNativeImeAdapter(); | 1189 return rwhva->GetNativeImeAdapter(); |
1190 } | 1190 } |
1191 | 1191 |
1192 void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter, | 1192 void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter, |
1193 int text_input_type, | 1193 int text_input_type, |
| 1194 int text_input_mode, |
1194 int text_input_flags, | 1195 int text_input_flags, |
1195 const std::string& text, | 1196 const std::string& text, |
1196 int selection_start, | 1197 int selection_start, |
1197 int selection_end, | 1198 int selection_end, |
1198 int composition_start, | 1199 int composition_start, |
1199 int composition_end, | 1200 int composition_end, |
1200 bool show_ime_if_needed, | 1201 bool show_ime_if_needed, |
1201 bool is_non_ime_change) { | 1202 bool is_non_ime_change) { |
1202 JNIEnv* env = AttachCurrentThread(); | 1203 JNIEnv* env = AttachCurrentThread(); |
1203 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1204 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1204 if (obj.is_null()) | 1205 if (obj.is_null()) |
1205 return; | 1206 return; |
1206 | 1207 |
1207 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); | 1208 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); |
1208 Java_ContentViewCore_updateImeAdapter(env, | 1209 Java_ContentViewCore_updateImeAdapter(env, |
1209 obj.obj(), | 1210 obj.obj(), |
1210 native_ime_adapter, | 1211 native_ime_adapter, |
1211 text_input_type, | 1212 text_input_type, |
| 1213 text_input_mode, |
1212 text_input_flags, | 1214 text_input_flags, |
1213 jstring_text.obj(), | 1215 jstring_text.obj(), |
1214 selection_start, | 1216 selection_start, |
1215 selection_end, | 1217 selection_end, |
1216 composition_start, | 1218 composition_start, |
1217 composition_end, | 1219 composition_end, |
1218 show_ime_if_needed, | 1220 show_ime_if_needed, |
1219 is_non_ime_change); | 1221 is_non_ime_change); |
1220 } | 1222 } |
1221 | 1223 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1349 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1348 retained_objects_set); | 1350 retained_objects_set); |
1349 return reinterpret_cast<intptr_t>(view); | 1351 return reinterpret_cast<intptr_t>(view); |
1350 } | 1352 } |
1351 | 1353 |
1352 bool RegisterContentViewCore(JNIEnv* env) { | 1354 bool RegisterContentViewCore(JNIEnv* env) { |
1353 return RegisterNativesImpl(env); | 1355 return RegisterNativesImpl(env); |
1354 } | 1356 } |
1355 | 1357 |
1356 } // namespace content | 1358 } // namespace content |
OLD | NEW |