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

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

Issue 715733002: [Android] Show autofill popup after animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 11 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
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 2c48d11bd60520134cfd5c5f5539c0ac1f40105e..93d06956d917760add230ba81f0eb63f860ada7f 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -49,6 +49,7 @@
using blink::WebAutofillClient;
using blink::WebConsoleMessage;
+using blink::WebDocument;
using blink::WebElement;
using blink::WebElementCollection;
using blink::WebFormControlElement;
@@ -215,12 +216,6 @@ void AutofillAgent::FocusedNodeChanged(const WebNode& node) {
if (node.document().frame() != render_frame()->GetWebFrame())
return;
- if (password_generation_agent_ &&
- password_generation_agent_->FocusedNodeHasChanged(node)) {
- is_popup_possibly_visible_ = true;
- return;
- }
-
WebElement web_element = node.toConst<WebElement>();
if (!web_element.document().frame())
@@ -229,12 +224,24 @@ void AutofillAgent::FocusedNodeChanged(const WebNode& node) {
const WebInputElement* element = toWebInputElement(&web_element);
if (!element || !element->isEnabled() || element->isReadOnly() ||
- !element->isTextField() || element->isPasswordField())
+ !element->isTextField())
return;
element_ = *element;
}
+void AutofillAgent::FocusChangeComplete() {
+ WebDocument doc = render_frame()->GetWebFrame()->document();
+ WebElement focused_element;
+ if (!doc.isNull())
+ focused_element = doc.focusedElement();
+
+ if (!focused_element.isNull() && password_generation_agent_ &&
+ password_generation_agent_->FocusedNodeHasChanged(focused_element)) {
+ is_popup_possibly_visible_ = true;
+ }
+}
+
void AutofillAgent::didRequestAutocomplete(
const WebFormElement& form) {
DCHECK_EQ(form.document().frame(), render_frame()->GetWebFrame());
@@ -783,4 +790,8 @@ void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged(
agent_->FocusedNodeChanged(node);
}
+void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() {
+ agent_->FocusChangeComplete();
+}
+
} // namespace autofill
« no previous file with comments | « components/autofill/content/renderer/autofill_agent.h ('k') | components/autofill/content/renderer/form_autofill_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698