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 e1437b451ef82a6ccbdaa7bcdb0cfded5a8c3592..b041d172a5c18ef9552094caa9eb7e85ab358d63 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
@@ -43,6 +43,7 @@ |
#include "content/browser/android/overscroll_controller_android.h" |
#include "content/browser/android/selection_popup_controller.h" |
#include "content/browser/android/synchronous_compositor_host.h" |
+#include "content/browser/android/text_suggestion_host_android.h" |
#include "content/browser/compositor/surface_utils.h" |
#include "content/browser/devtools/render_frame_devtools_agent_host.h" |
#include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
@@ -452,6 +453,7 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( |
content_view_core_(nullptr), |
ime_adapter_android_(nullptr), |
selection_popup_controller_(nullptr), |
+ text_suggestion_host_(nullptr), |
background_color_(SK_ColorWHITE), |
cached_background_color_(SK_ColorWHITE), |
view_(this), |
@@ -942,6 +944,11 @@ bool RenderWidgetHostViewAndroid::OnTouchEvent( |
ComputeEventLatencyOSTouchHistograms(event); |
+ // Receiving any other touch event before the double-tap timeout expires |
+ // cancels opening the spellcheck menu. |
+ if (text_suggestion_host_) |
+ text_suggestion_host_->StopSpellCheckMenuTimer(); |
+ |
// If a browser-based widget consumes the touch event, it's critical that |
// touch event interception be disabled. This avoids issues with |
// double-handling for embedder-detected gestures like side swipe. |
@@ -1035,6 +1042,8 @@ void RenderWidgetHostViewAndroid::FocusedNodeChanged( |
const gfx::Rect& node_bounds_in_screen) { |
if (ime_adapter_android_) |
ime_adapter_android_->FocusedNodeChanged(is_editable_node); |
+ if (text_suggestion_host_) |
+ text_suggestion_host_->FocusedNodeChanged(); |
} |
void RenderWidgetHostViewAndroid::RenderProcessGone( |
@@ -1786,6 +1795,11 @@ void RenderWidgetHostViewAndroid::SendKeyEvent( |
if (!target_host) |
return; |
+ // Receiving a key event before the double-tap timeout expires cancels opening |
+ // the spellcheck menu. |
+ if (text_suggestion_host_) |
+ text_suggestion_host_->StopSpellCheckMenuTimer(); |
+ |
ui::LatencyInfo latency_info; |
if (event.GetType() == blink::WebInputEvent::kRawKeyDown || |
event.GetType() == blink::WebInputEvent::kChar) { |