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

Unified Diff: components/autofill/content/renderer/page_click_tracker.cc

Issue 1304923002: Only user gesture focus change and mouse click show autofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Early return after updating was_focused_before_now_. Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/page_click_tracker.cc
diff --git a/components/autofill/content/renderer/page_click_tracker.cc b/components/autofill/content/renderer/page_click_tracker.cc
index 56fbb5345065030cd9750dee58128d52958f27e3..dc2db53c6fa46d9a0185cc3897d6c1eda8de63dd 100644
--- a/components/autofill/content/renderer/page_click_tracker.cc
+++ b/components/autofill/content/renderer/page_click_tracker.cc
@@ -18,6 +18,7 @@
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebLocalFrame.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"
using blink::WebElement;
@@ -29,6 +30,7 @@ using blink::WebNode;
using blink::WebPoint;
using blink::WebSize;
using blink::WebTextAreaElement;
+using blink::WebUserGestureIndicator;
namespace {
@@ -77,11 +79,17 @@ PageClickTracker::~PageClickTracker() {
void PageClickTracker::OnMouseDown(const WebNode& mouse_down_node) {
focused_node_was_last_clicked_ = !mouse_down_node.isNull() &&
mouse_down_node.focused();
+
+ if (IsKeyboardAccessoryEnabled())
+ DoFocusChangeComplete();
}
void PageClickTracker::FocusedNodeChanged(const WebNode& node) {
was_focused_before_now_ = false;
+ if (!WebUserGestureIndicator::isProcessingUserGesture())
Evan Stade 2015/09/08 21:26:32 I think this makes more sense as if (IsKeyboardAc
please use gerrit instead 2015/09/09 00:20:16 Done.
+ return;
+
if (IsKeyboardAccessoryEnabled()) {
focused_node_was_last_clicked_ = true;
DoFocusChangeComplete();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698