Index: content/browser/renderer_host/render_widget_host_view_android.cc |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
index acb9d446490d808e0669d3f9aa1abc3456dcc0e6..46113c71a41378de43bc01db2ce14fbdba0d22a1 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
@@ -652,22 +652,19 @@ long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
return reinterpret_cast<intptr_t>(&ime_adapter_android_); |
} |
-void RenderWidgetHostViewAndroid::TextInputStateChanged( |
- const ViewHostMsg_TextInputState_Params& params) { |
- if (params.is_non_ime_change) { |
- // Sends an acknowledgement to the renderer of a processed IME event. |
- host_->Send(new InputMsg_ImeEventAck(host_->GetRoutingID())); |
- } |
- |
+void RenderWidgetHostViewAndroid::UpdateInputMethodIfNecessary( |
+ bool text_input_state_changed) { |
+ DCHECK(text_input_state_changed); |
if (!content_view_core_) |
return; |
+ const TextInputState* state = host_->delegate()->GetTextInputState(); |
+ |
content_view_core_->UpdateImeAdapter( |
- GetNativeImeAdapter(), |
- static_cast<int>(params.type), params.flags, |
- params.value, params.selection_start, params.selection_end, |
- params.composition_start, params.composition_end, |
- params.show_ime_if_needed, params.is_non_ime_change); |
+ GetNativeImeAdapter(), static_cast<int>(state->type), state->flags, |
+ state->value, state->selection_start, state->selection_end, |
+ state->composition_start, state->composition_end, |
+ state->show_ime_if_needed, state->is_non_ime_change); |
} |
void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { |
@@ -813,6 +810,10 @@ void RenderWidgetHostViewAndroid::Destroy() { |
} |
surface_factory_.reset(); |
+ // The WebContentsImpl should be notified about us so that it will not hold |
+ // an invalid text input state which was due to active text on this view. |
+ NotifyHostDelegateAboutShutdown(); |
+ |
// The RenderWidgetHost's destruction led here, so don't call it. |
host_ = NULL; |