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 f172bbc7ecfced10d4d9c66c65c8218b45f55859..80f5d6965f2d08a8426a87cb5b18de5d7d204774 100644 |
--- a/components/autofill/content/renderer/autofill_agent.cc |
+++ b/components/autofill/content/renderer/autofill_agent.cc |
@@ -292,8 +292,15 @@ void AutofillAgent::setIgnoreTextChanges(bool ignore) { |
void AutofillAgent::InputElementClicked(const WebInputElement& element, |
bool was_focused, |
bool is_focused) { |
- if (was_focused) |
- ShowSuggestions(element, true, false, true, false); |
+ bool show_full_suggestion_list = element.isAutofilled() || was_focused; |
Garrett Casto
2014/03/06 01:23:46
I think that this was fine before hand with just e
jww
2014/03/07 02:06:06
I changed this because the experience, I felt, was
|
+ bool show_password_suggestions_only = !was_focused; |
+ ShowSuggestions(element, |
+ true, |
+ false, |
+ true, |
+ false, |
+ show_full_suggestion_list, |
+ show_password_suggestions_only); |
} |
void AutofillAgent::InputElementLostFocus() { |
@@ -342,7 +349,7 @@ void AutofillAgent::TextFieldDidChangeImpl(const WebInputElement& element) { |
return; |
} |
- ShowSuggestions(element, false, true, false, false); |
+ ShowSuggestions(element, false, true, false, false, false, false); |
FormData form; |
FormFieldData field; |
@@ -361,11 +368,11 @@ void AutofillAgent::textFieldDidReceiveKeyDown(const WebInputElement& element, |
if (event.windowsKeyCode == ui::VKEY_DOWN || |
event.windowsKeyCode == ui::VKEY_UP) |
- ShowSuggestions(element, true, true, true, false); |
+ ShowSuggestions(element, true, true, true, false, false, false); |
} |
void AutofillAgent::openTextDataListChooser(const WebInputElement& element) { |
- ShowSuggestions(element, true, false, false, true); |
+ ShowSuggestions(element, true, false, false, true, false, false); |
} |
void AutofillAgent::AcceptDataListSuggestion( |
@@ -496,7 +503,9 @@ void AutofillAgent::ShowSuggestions(const WebInputElement& element, |
bool autofill_on_empty_values, |
bool requires_caret_at_end, |
bool display_warning_if_disabled, |
- bool datalist_only) { |
+ bool datalist_only, |
+ bool show_full_suggestion_list, |
+ bool show_password_suggestions_only) { |
if (!element.isEnabled() || element.isReadOnly() || !element.isTextField() || |
element.isPasswordField()) |
return; |
@@ -518,7 +527,9 @@ void AutofillAgent::ShowSuggestions(const WebInputElement& element, |
} |
element_ = element; |
- if (password_autofill_agent_->ShowSuggestions(element)) { |
+ if (password_autofill_agent_->ShowSuggestions(element, |
+ show_full_suggestion_list) || |
+ show_password_suggestions_only) { |
is_popup_possibly_visible_ = true; |
return; |
} |