| 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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 | 1191 |
| 1192 long ContentViewCoreImpl::GetNativeImeAdapter(JNIEnv* env, jobject obj) { | 1192 long ContentViewCoreImpl::GetNativeImeAdapter(JNIEnv* env, jobject obj) { |
| 1193 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | 1193 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
| 1194 if (!rwhva) | 1194 if (!rwhva) |
| 1195 return 0; | 1195 return 0; |
| 1196 return rwhva->GetNativeImeAdapter(); | 1196 return rwhva->GetNativeImeAdapter(); |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter, | 1199 void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter, |
| 1200 int text_input_type, | 1200 int text_input_type, |
| 1201 int text_input_mode, |
| 1201 int text_input_flags, | 1202 int text_input_flags, |
| 1202 const std::string& text, | 1203 const std::string& text, |
| 1203 int selection_start, | 1204 int selection_start, |
| 1204 int selection_end, | 1205 int selection_end, |
| 1205 int composition_start, | 1206 int composition_start, |
| 1206 int composition_end, | 1207 int composition_end, |
| 1207 bool show_ime_if_needed, | 1208 bool show_ime_if_needed, |
| 1208 bool is_non_ime_change) { | 1209 bool is_non_ime_change) { |
| 1209 JNIEnv* env = AttachCurrentThread(); | 1210 JNIEnv* env = AttachCurrentThread(); |
| 1210 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1211 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1211 if (obj.is_null()) | 1212 if (obj.is_null()) |
| 1212 return; | 1213 return; |
| 1213 | 1214 |
| 1214 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); | 1215 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); |
| 1215 Java_ContentViewCore_updateImeAdapter(env, | 1216 Java_ContentViewCore_updateImeAdapter(env, |
| 1216 obj.obj(), | 1217 obj.obj(), |
| 1217 native_ime_adapter, | 1218 native_ime_adapter, |
| 1218 text_input_type, | 1219 text_input_type, |
| 1220 text_input_mode, |
| 1219 text_input_flags, | 1221 text_input_flags, |
| 1220 jstring_text.obj(), | 1222 jstring_text.obj(), |
| 1221 selection_start, | 1223 selection_start, |
| 1222 selection_end, | 1224 selection_end, |
| 1223 composition_start, | 1225 composition_start, |
| 1224 composition_end, | 1226 composition_end, |
| 1225 show_ime_if_needed, | 1227 show_ime_if_needed, |
| 1226 is_non_ime_change); | 1228 is_non_ime_change); |
| 1227 } | 1229 } |
| 1228 | 1230 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1356 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1355 retained_objects_set); | 1357 retained_objects_set); |
| 1356 return reinterpret_cast<intptr_t>(view); | 1358 return reinterpret_cast<intptr_t>(view); |
| 1357 } | 1359 } |
| 1358 | 1360 |
| 1359 bool RegisterContentViewCore(JNIEnv* env) { | 1361 bool RegisterContentViewCore(JNIEnv* env) { |
| 1360 return RegisterNativesImpl(env); | 1362 return RegisterNativesImpl(env); |
| 1361 } | 1363 } |
| 1362 | 1364 |
| 1363 } // namespace content | 1365 } // namespace content |
| OLD | NEW |