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

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: Single if statement. 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..b6a383d475080c90f5b31fd5d862db01e494e733 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,12 +79,16 @@ 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 (IsKeyboardAccessoryEnabled()) {
+ if (IsKeyboardAccessoryEnabled() &&
+ WebUserGestureIndicator::isProcessingUserGesture()) {
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