Index: components/autofill/content/renderer/autofill_agent.cc |
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc |
index 31068330ae94793b6238892e9bc27b57bc7ca8d7..980586edf9eecac01666bc0cc182eca32e18eb6c 100644 |
--- a/components/autofill/content/renderer/autofill_agent.cc |
+++ b/components/autofill/content/renderer/autofill_agent.cc |
@@ -43,6 +43,7 @@ |
#include "third_party/WebKit/public/web/WebNode.h" |
#include "third_party/WebKit/public/web/WebOptionElement.h" |
#include "third_party/WebKit/public/web/WebTextAreaElement.h" |
+#include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
#include "third_party/WebKit/public/web/WebView.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/events/keycodes/keyboard_codes.h" |
@@ -62,6 +63,7 @@ using blink::WebNode; |
using blink::WebOptionElement; |
using blink::WebString; |
using blink::WebTextAreaElement; |
+using blink::WebUserGestureIndicator; |
using blink::WebVector; |
namespace autofill { |
@@ -381,6 +383,16 @@ void AutofillAgent::textFieldDidChange(const WebFormControlElement& element) { |
if (ignore_text_changes_) |
return; |
+ if (!WebUserGestureIndicator::isProcessingUserGesture()) |
+ return; |
+ |
+#if !defined(OS_ANDROID) |
+ // IME composition on desktop is used for CJK, which will conflict with |
+ // autofill popup near the input field. |
+ if (render_frame()->GetWebFrame()->hasComposition()) |
+ return; |
+#endif |
+ |
DCHECK(toWebInputElement(&element) || IsTextAreaElement(element)); |
if (did_set_node_text_) { |
Evan Stade
2015/04/16 13:58:59
there are a lot of early returns here. Can we make
|