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

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: Created 5 years, 4 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 193dd7aea88b023c6902f34bc7f3e63dc2492d73..151865e80e97edaf6ddddd8120fcd07f13bac7e9 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 {
@@ -75,11 +77,22 @@ PageClickTracker::~PageClickTracker() {
}
void PageClickTracker::OnMouseDown(const WebNode& mouse_down_node) {
Evan Stade 2015/08/21 15:16:19 does a tap count as a "mouse down" here? if not wh
please use gerrit instead 2015/08/24 17:58:42 See http://crrev.com/1195473005 for context. Both
+ if (!WebUserGestureIndicator::isProcessingUserGesture())
Evan Stade 2015/08/21 15:16:19 schwa? How can you have onmousedown that's not a
please use gerrit instead 2015/08/24 17:58:42 I expected document.getElementsByTagName('input')[
+ return;
+
focused_node_was_last_clicked_ = !mouse_down_node.isNull() &&
mouse_down_node.focused();
+
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAccessorySuggestionView)) {
+ DoFocusChangeComplete();
Evan Stade 2015/08/21 15:16:19 remind me why we need different handling on androi
please use gerrit instead 2015/08/24 17:58:42 We need different handling for keyboard accessory
+ }
}
void PageClickTracker::FocusedNodeChanged(const WebNode& node) {
+ if (!WebUserGestureIndicator::isProcessingUserGesture())
+ return;
+
was_focused_before_now_ = false;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
« 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