Commit 9a308ecb authored by Jihwan Marc Kim's avatar Jihwan Marc Kim Committed by Commit Bot

Reorder parameters for PasswordManager::BuildSuggestions()

Existing PasswordManager::BuildSuggestions helper is quite convoluted,
reorder the parameters.

Bug: 1046756
Change-Id: I82e50d08954bae9f94268759800051c6eb20465f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032627Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737727}
parent 841e2c96
......@@ -366,10 +366,10 @@ void PasswordAutofillManager::OnAddPasswordFillData(
if (!autofill_client_ || autofill_client_->GetPopupSuggestions().empty())
return;
// TODO(https://crbug.com/1043963): Add empty state.
UpdatePopup(BuildSuggestions(ShowAllPasswords(true),
UpdatePopup(BuildSuggestions(base::string16(),
ForPasswordField(AreSuggestionForPasswordField(
autofill_client_->GetPopupSuggestions())),
base::string16(), OffersGeneration(false),
ShowAllPasswords(true), OffersGeneration(false),
ShowPasswordSuggestions(true)));
}
......@@ -388,10 +388,10 @@ void PasswordAutofillManager::OnShowPasswordSuggestions(
const gfx::RectF& bounds) {
ShowPopup(
bounds, text_direction,
BuildSuggestions(ShowAllPasswords(options & autofill::SHOW_ALL),
BuildSuggestions(typed_username,
ForPasswordField(options & autofill::IS_PASSWORD_FIELD),
typed_username, OffersGeneration(false),
ShowPasswordSuggestions(true)));
ShowAllPasswords(options & autofill::SHOW_ALL),
OffersGeneration(false), ShowPasswordSuggestions(true)));
}
bool PasswordAutofillManager::MaybeShowPasswordSuggestions(
......@@ -399,8 +399,8 @@ bool PasswordAutofillManager::MaybeShowPasswordSuggestions(
base::i18n::TextDirection text_direction) {
return ShowPopup(
bounds, text_direction,
BuildSuggestions(ShowAllPasswords(true), ForPasswordField(true),
base::string16(), OffersGeneration(false),
BuildSuggestions(base::string16(), ForPasswordField(true),
ShowAllPasswords(true), OffersGeneration(false),
ShowPasswordSuggestions(true)));
}
......@@ -410,8 +410,8 @@ bool PasswordAutofillManager::MaybeShowPasswordSuggestionsWithGeneration(
bool show_password_suggestions) {
return ShowPopup(
bounds, text_direction,
BuildSuggestions(ShowAllPasswords(true), ForPasswordField(true),
base::string16(), OffersGeneration(true),
BuildSuggestions(base::string16(), ForPasswordField(true),
ShowAllPasswords(true), OffersGeneration(true),
ShowPasswordSuggestions(show_password_suggestions)));
}
......@@ -435,9 +435,9 @@ bool PasswordAutofillManager::PreviewSuggestionForTest(
// PasswordAutofillManager, private:
std::vector<autofill::Suggestion> PasswordAutofillManager::BuildSuggestions(
ShowAllPasswords show_all_passwords,
const base::string16& username_filter,
ForPasswordField for_password_field,
const base::string16& typed_username,
ShowAllPasswords show_all_passwords,
OffersGeneration offers_generation,
ShowPasswordSuggestions show_password_suggestions) {
std::vector<autofill::Suggestion> suggestions;
......@@ -453,7 +453,7 @@ std::vector<autofill::Suggestion> PasswordAutofillManager::BuildSuggestions(
// Add password suggestions if they exist and were requested.
if (show_password_suggestions && fill_data_) {
GetSuggestions(*fill_data_, typed_username, page_favicon_,
GetSuggestions(*fill_data_, username_filter, page_favicon_,
show_all_passwords.value(), for_password_field.value(),
&suggestions);
}
......
......@@ -114,9 +114,9 @@ class PasswordAutofillManager : public autofill::AutofillPopupDelegate {
// Builds the suggestions used to show or update the autofill popup.
std::vector<autofill::Suggestion> BuildSuggestions(
ShowAllPasswords show_all_passwords,
const base::string16& username_filter,
ForPasswordField for_password_field,
const base::string16& typed_username,
ShowAllPasswords show_all_passwords,
OffersGeneration for_generation,
ShowPasswordSuggestions show_password_suggestions);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment