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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 2523753003: Add inputmode to android ImeAdapater. (Closed)
Patch Set: Rebase Created 4 years 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 unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 JNIEnv* env = AttachCurrentThread(); 1270 JNIEnv* env = AttachCurrentThread();
1271 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1271 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1272 if (obj.is_null()) 1272 if (obj.is_null())
1273 return; 1273 return;
1274 Java_ContentViewCore_forceUpdateImeAdapter(env, obj, native_ime_adapter); 1274 Java_ContentViewCore_forceUpdateImeAdapter(env, obj, native_ime_adapter);
1275 } 1275 }
1276 1276
1277 void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter, 1277 void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter,
1278 int text_input_type, 1278 int text_input_type,
1279 int text_input_flags, 1279 int text_input_flags,
1280 int text_input_mode,
1280 const std::string& text, 1281 const std::string& text,
1281 int selection_start, 1282 int selection_start,
1282 int selection_end, 1283 int selection_end,
1283 int composition_start, 1284 int composition_start,
1284 int composition_end, 1285 int composition_end,
1285 bool show_ime_if_needed, 1286 bool show_ime_if_needed,
1286 bool is_non_ime_change) { 1287 bool is_non_ime_change) {
1287 JNIEnv* env = AttachCurrentThread(); 1288 JNIEnv* env = AttachCurrentThread();
1288 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1289 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1289 if (obj.is_null()) 1290 if (obj.is_null())
1290 return; 1291 return;
1291 1292
1292 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); 1293 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text);
1293 Java_ContentViewCore_updateImeAdapter( 1294 Java_ContentViewCore_updateImeAdapter(
1294 env, obj, native_ime_adapter, text_input_type, text_input_flags, 1295 env, obj, native_ime_adapter, text_input_type, text_input_flags,
1295 jstring_text, selection_start, selection_end, composition_start, 1296 text_input_mode, jstring_text, selection_start, selection_end,
1296 composition_end, show_ime_if_needed, is_non_ime_change); 1297 composition_start, composition_end, show_ime_if_needed,
1298 is_non_ime_change);
1297 } 1299 }
1298 1300
1299 void ContentViewCoreImpl::SetAccessibilityEnabled( 1301 void ContentViewCoreImpl::SetAccessibilityEnabled(
1300 JNIEnv* env, 1302 JNIEnv* env,
1301 const JavaParamRef<jobject>& obj, 1303 const JavaParamRef<jobject>& obj,
1302 bool enabled) { 1304 bool enabled) {
1303 SetAccessibilityEnabledInternal(enabled); 1305 SetAccessibilityEnabledInternal(enabled);
1304 } 1306 }
1305 1307
1306 void ContentViewCoreImpl::SetTextTrackSettings( 1308 void ContentViewCoreImpl::SetTextTrackSettings(
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 return ScopedJavaLocalRef<jobject>(); 1598 return ScopedJavaLocalRef<jobject>();
1597 1599
1598 return view->GetJavaObject(); 1600 return view->GetJavaObject();
1599 } 1601 }
1600 1602
1601 bool RegisterContentViewCore(JNIEnv* env) { 1603 bool RegisterContentViewCore(JNIEnv* env) {
1602 return RegisterNativesImpl(env); 1604 return RegisterNativesImpl(env);
1603 } 1605 }
1604 1606
1605 } // namespace content 1607 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698