+void RWHVAuraOffscreenHelperEfl::TextInputStateChanged(
+ const ui::mojom::TextInputState& params) {
+ auto im_context = GetIMContextEfl();
+ if (!im_context) {
+ LOG(ERROR) << "im_context is nullptr";
+ return;
+ }
+
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (!rwhv_aura_->IsShowing() || !HasFocus())
+#else
+ if (!rwhv_aura_->IsShowing())
+#endif
+ return;
+
+ bool show_ime_if_needed = params.show_ime_if_needed;
+
+ if (show_ime_if_needed && !params.is_user_action)
+ show_ime_if_needed = false;
+
+ // Prevent scroll and zoom for autofocus'ed elements.
+ if (show_ime_if_needed && params.type != ui::TEXT_INPUT_TYPE_NONE) {
+ // If webview isn't resized yet, return previous IME state.
+ bool is_ime_show = im_context->WebViewWillBeResized()
+ ? !im_context->IsVisible()
+ : im_context->IsVisible();
+ if (im_context && !is_ime_show)
+ is_scrolling_needed_ = true;
+ }
+
+ if (im_context) {
+ im_context->SetIsInFormTag(params.is_in_form_tag);
+#if BUILDFLAG(IS_TIZEN_TV)
+ im_context->UpdateInputMethodState(
+ params.type, params.can_compose_inline, show_ime_if_needed,
+ password_input_minlength_, input_maxlength_);
+#else
+ im_context->UpdateInputMethodState(params.type, params.can_compose_inline,
+ show_ime_if_needed);
+#endif
+ }
+}
+
+void RWHVAuraOffscreenHelperEfl::FocusedNodeChanged(
+ bool editable
+#if BUILDFLAG(IS_TIZEN_TV)
+ ,
+ bool is_radio_or_checkbox,
+ int password_input_minlength,
+ int input_maxlength
+#endif
+) {
+
+#if BUILDFLAG(IS_TIZEN_TV)
+ radio_or_checkbox_focused_ = is_radio_or_checkbox;
+ password_input_minlength_ = password_input_minlength;
+ input_maxlength_ = input_maxlength;
+#endif
+
+ auto im_context = GetIMContextEfl();
+ if (im_context && is_focused_node_editable_) {
+ // focus out from an editable node,
+ // need reset ime context.
+ // or else will cause previous preedit text be copied.
+ if (im_context->IsVisible()) {
+ im_context->CancelComposition();
+ } else {
+ // add ime focus out when focus out from an editable node.
+ im_context->OnFocusOut();
+ }
+ }
+ is_focused_node_editable_ = editable;
+}
+