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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 1663013005: [DO NOT REVIEW] Always calling Notify for android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trying to Fix MAC Created 4 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
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;

Powered by Google App Engine
This is Rietveld 408576698