| 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 72d65706c6e43e068996b35192fd2aecbfeab108..d9cf619aaaaa6d2e242772e433eb3cd15c28d261 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
|
| @@ -639,22 +639,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;
|
|
|
| + 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) {
|
| @@ -800,6 +797,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;
|
|
|
|
|