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/autofill_agent.cc

Issue 715733002: [Android] Show autofill popup after animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hide popup when resizing the viewport resulted in movement of the focused element. Created 6 years 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 16c8c0f3a20914baac33c436019651887dcbe61b..a722f53160a2251aa8335913addeb51e2bf7c515 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -228,12 +228,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())
@@ -252,7 +246,7 @@ void AutofillAgent::OrientationChangeEvent() {
HidePopup();
}
-void AutofillAgent::Resized() {
+void AutofillAgent::FocusedElementMovedOnResize() {
HidePopup();
}
@@ -339,6 +333,12 @@ void AutofillAgent::FormControlElementClicked(
if (!input_element && !IsTextAreaElement(element))
return;
+ if (password_generation_agent_ &&
+ password_generation_agent_->FocusedNodeHasChanged(*input_element)) {
+ is_popup_possibly_visible_ = true;
+ return;
+ }
+
ShowSuggestionsOptions options;
options.autofill_on_empty_values = true;
options.display_warning_if_disabled = true;
@@ -348,12 +348,6 @@ void AutofillAgent::FormControlElementClicked(
switches::kEnableSingleClickAutofill)) {
// Show full suggestions when clicking on an already-focused form field. On
// the initial click (not focused yet), only show password suggestions.
-#if defined(OS_ANDROID)
- // TODO(gcasto): Remove after crbug.com/430318 has been fixed.
- if (!was_focused)
- return;
-#endif
-
options.show_full_suggestion_list =
options.show_full_suggestion_list || was_focused;
options.show_password_suggestions_only = !was_focused;
@@ -836,8 +830,8 @@ void AutofillAgent::LegacyAutofillAgent::OrientationChangeEvent() {
agent_->OrientationChangeEvent();
}
-void AutofillAgent::LegacyAutofillAgent::Resized() {
- agent_->Resized();
+void AutofillAgent::LegacyAutofillAgent::FocusedElementMovedOnResize() {
+ agent_->FocusedElementMovedOnResize();
}
void AutofillAgent::LegacyAutofillAgent::FrameWillClose(
« no previous file with comments | « components/autofill/content/renderer/autofill_agent.h ('k') | components/autofill/content/renderer/page_click_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698