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

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

Issue 2777223004: Migrate IME state update flow (Closed)
Patch Set: rebase Created 3 years, 8 months 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 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 void ContentViewCoreImpl::WasResized(JNIEnv* env, 1080 void ContentViewCoreImpl::WasResized(JNIEnv* env,
1081 const JavaParamRef<jobject>& obj) { 1081 const JavaParamRef<jobject>& obj) {
1082 gfx::Size physical_size( 1082 gfx::Size physical_size(
1083 Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj), 1083 Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj),
1084 Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj)); 1084 Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj));
1085 GetViewAndroid()->GetLayer()->SetBounds(physical_size); 1085 GetViewAndroid()->GetLayer()->SetBounds(physical_size);
1086 1086
1087 SendScreenRectsAndResizeWidget(); 1087 SendScreenRectsAndResizeWidget();
1088 } 1088 }
1089 1089
1090 void ContentViewCoreImpl::UpdateImeAdapter(int text_input_type,
1091 int text_input_flags,
1092 int text_input_mode,
1093 const std::string& text,
1094 int selection_start,
1095 int selection_end,
1096 int composition_start,
1097 int composition_end,
1098 bool show_ime_if_needed,
1099 bool reply_to_request) {
1100 JNIEnv* env = AttachCurrentThread();
1101 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1102 if (obj.is_null())
1103 return;
1104
1105 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text);
1106 Java_ContentViewCore_updateImeAdapter(
1107 env, obj, text_input_type, text_input_flags, text_input_mode,
1108 jstring_text, selection_start, selection_end, composition_start,
1109 composition_end, show_ime_if_needed, reply_to_request);
1110 }
1111
1112 void ContentViewCoreImpl::SetAccessibilityEnabled( 1090 void ContentViewCoreImpl::SetAccessibilityEnabled(
1113 JNIEnv* env, 1091 JNIEnv* env,
1114 const JavaParamRef<jobject>& obj, 1092 const JavaParamRef<jobject>& obj,
1115 bool enabled) { 1093 bool enabled) {
1116 SetAccessibilityEnabledInternal(enabled); 1094 SetAccessibilityEnabledInternal(enabled);
1117 } 1095 }
1118 1096
1119 void ContentViewCoreImpl::SetTextTrackSettings( 1097 void ContentViewCoreImpl::SetTextTrackSettings(
1120 JNIEnv* env, 1098 JNIEnv* env,
1121 const JavaParamRef<jobject>& obj, 1099 const JavaParamRef<jobject>& obj,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 return ScopedJavaLocalRef<jobject>(); 1324 return ScopedJavaLocalRef<jobject>();
1347 1325
1348 return view->GetJavaObject(); 1326 return view->GetJavaObject();
1349 } 1327 }
1350 1328
1351 bool RegisterContentViewCore(JNIEnv* env) { 1329 bool RegisterContentViewCore(JNIEnv* env) {
1352 return RegisterNativesImpl(env); 1330 return RegisterNativesImpl(env);
1353 } 1331 }
1354 1332
1355 } // namespace content 1333 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/android/ime_adapter_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698