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 ee1ddd2970ef00e42208fa5675e9996f44bf9398..3c8c7c3ce1041a0c68070073c2be699c86c30c5d 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 { |
@@ -154,6 +156,7 @@ AutofillAgent::AutofillAgent(content::RenderFrame* render_frame, |
did_set_node_text_(false), |
ignore_text_changes_(false), |
is_popup_possibly_visible_(false), |
+ disable_user_gesture_check_(false), |
weak_ptr_factory_(this) { |
render_frame->GetWebFrame()->setAutofillClient(this); |
@@ -385,6 +388,11 @@ void AutofillAgent::textFieldDidChange(const WebFormControlElement& element) { |
if (ignore_text_changes_) |
return; |
+ if (!WebUserGestureIndicator::isProcessingUserGesture() && |
+ !disable_user_gesture_check_) { |
+ return; |
+ } |
+ |
DCHECK(toWebInputElement(&element) || IsTextAreaElement(element)); |
if (did_set_node_text_) { |