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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 2785543003: Revert of Let ImeAdapterAndroid have the same lifecycle as its Java peer (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 08eaec6cb10d0e2a3b1d20cab45fcfb1b2634122..77e7ab21d9e105d10ec7a6a437e25efc27bd1061 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1132,7 +1132,25 @@
SendScreenRectsAndResizeWidget();
}
-void ContentViewCoreImpl::UpdateImeAdapter(int text_input_type,
+long ContentViewCoreImpl::GetNativeImeAdapter(
+ JNIEnv* env,
+ const JavaParamRef<jobject>& obj) {
+ RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
+ if (!rwhva)
+ return 0;
+ return rwhva->GetNativeImeAdapter();
+}
+
+void ContentViewCoreImpl::ForceUpdateImeAdapter(long native_ime_adapter) {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return;
+ Java_ContentViewCore_forceUpdateImeAdapter(env, obj, native_ime_adapter);
+}
+
+void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter,
+ int text_input_type,
int text_input_flags,
int text_input_mode,
const std::string& text,
@@ -1149,9 +1167,9 @@
ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text);
Java_ContentViewCore_updateImeAdapter(
- env, obj, text_input_type, text_input_flags, text_input_mode,
- jstring_text, selection_start, selection_end, composition_start,
- composition_end, show_ime_if_needed, reply_to_request);
+ env, obj, native_ime_adapter, text_input_type, text_input_flags,
+ text_input_mode, jstring_text, selection_start, selection_end,
+ composition_start, composition_end, show_ime_if_needed, reply_to_request);
}
void ContentViewCoreImpl::SetAccessibilityEnabled(
@@ -1358,7 +1376,7 @@
const JavaParamRef<jobject>& jweb_contents,
const JavaParamRef<jobject>& jview_android_delegate,
jlong jwindow_android,
- jfloat dip_scale,
+ jfloat dipScale,
const JavaParamRef<jobject>& retained_objects_set) {
WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
WebContents::FromJavaWebContents(jweb_contents));
@@ -1373,8 +1391,9 @@
DCHECK(window_android);
window_android->AddChild(view_android);
+ // TODO: pass dipScale.
ContentViewCoreImpl* view = new ContentViewCoreImpl(
- env, obj, web_contents, dip_scale, retained_objects_set);
+ env, obj, web_contents, dipScale, retained_objects_set);
return reinterpret_cast<intptr_t>(view);
}
« 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