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( ...@@ -366,10 +366,10 @@ void PasswordAutofillManager::OnAddPasswordFillData(
if (!autofill_client_ || autofill_client_->GetPopupSuggestions().empty()) if (!autofill_client_ || autofill_client_->GetPopupSuggestions().empty())
return; return;
// TODO(https://crbug.com/1043963): Add empty state. // TODO(https://crbug.com/1043963): Add empty state.
UpdatePopup(BuildSuggestions(ShowAllPasswords(true), UpdatePopup(BuildSuggestions(base::string16(),
ForPasswordField(AreSuggestionForPasswordField( ForPasswordField(AreSuggestionForPasswordField(
autofill_client_->GetPopupSuggestions())), autofill_client_->GetPopupSuggestions())),
base::string16(), OffersGeneration(false), ShowAllPasswords(true), OffersGeneration(false),
ShowPasswordSuggestions(true))); ShowPasswordSuggestions(true)));
} }
...@@ -388,10 +388,10 @@ void PasswordAutofillManager::OnShowPasswordSuggestions( ...@@ -388,10 +388,10 @@ void PasswordAutofillManager::OnShowPasswordSuggestions(
const gfx::RectF& bounds) { const gfx::RectF& bounds) {
ShowPopup( ShowPopup(
bounds, text_direction, bounds, text_direction,
BuildSuggestions(ShowAllPasswords(options & autofill::SHOW_ALL), BuildSuggestions(typed_username,
ForPasswordField(options & autofill::IS_PASSWORD_FIELD), ForPasswordField(options & autofill::IS_PASSWORD_FIELD),
typed_username, OffersGeneration(false), ShowAllPasswords(options & autofill::SHOW_ALL),
ShowPasswordSuggestions(true))); OffersGeneration(false), ShowPasswordSuggestions(true)));
} }
bool PasswordAutofillManager::MaybeShowPasswordSuggestions( bool PasswordAutofillManager::MaybeShowPasswordSuggestions(
...@@ -399,8 +399,8 @@ bool PasswordAutofillManager::MaybeShowPasswordSuggestions( ...@@ -399,8 +399,8 @@ bool PasswordAutofillManager::MaybeShowPasswordSuggestions(
base::i18n::TextDirection text_direction) { base::i18n::TextDirection text_direction) {
return ShowPopup( return ShowPopup(
bounds, text_direction, bounds, text_direction,
BuildSuggestions(ShowAllPasswords(true), ForPasswordField(true), BuildSuggestions(base::string16(), ForPasswordField(true),
base::string16(), OffersGeneration(false), ShowAllPasswords(true), OffersGeneration(false),
ShowPasswordSuggestions(true))); ShowPasswordSuggestions(true)));
} }
...@@ -410,8 +410,8 @@ bool PasswordAutofillManager::MaybeShowPasswordSuggestionsWithGeneration( ...@@ -410,8 +410,8 @@ bool PasswordAutofillManager::MaybeShowPasswordSuggestionsWithGeneration(
bool show_password_suggestions) { bool show_password_suggestions) {
return ShowPopup( return ShowPopup(
bounds, text_direction, bounds, text_direction,
BuildSuggestions(ShowAllPasswords(true), ForPasswordField(true), BuildSuggestions(base::string16(), ForPasswordField(true),
base::string16(), OffersGeneration(true), ShowAllPasswords(true), OffersGeneration(true),
ShowPasswordSuggestions(show_password_suggestions))); ShowPasswordSuggestions(show_password_suggestions)));
} }
...@@ -435,9 +435,9 @@ bool PasswordAutofillManager::PreviewSuggestionForTest( ...@@ -435,9 +435,9 @@ bool PasswordAutofillManager::PreviewSuggestionForTest(
// PasswordAutofillManager, private: // PasswordAutofillManager, private:
std::vector<autofill::Suggestion> PasswordAutofillManager::BuildSuggestions( std::vector<autofill::Suggestion> PasswordAutofillManager::BuildSuggestions(
ShowAllPasswords show_all_passwords, const base::string16& username_filter,
ForPasswordField for_password_field, ForPasswordField for_password_field,
const base::string16& typed_username, ShowAllPasswords show_all_passwords,
OffersGeneration offers_generation, OffersGeneration offers_generation,
ShowPasswordSuggestions show_password_suggestions) { ShowPasswordSuggestions show_password_suggestions) {
std::vector<autofill::Suggestion> suggestions; std::vector<autofill::Suggestion> suggestions;
...@@ -453,7 +453,7 @@ std::vector<autofill::Suggestion> PasswordAutofillManager::BuildSuggestions( ...@@ -453,7 +453,7 @@ std::vector<autofill::Suggestion> PasswordAutofillManager::BuildSuggestions(
// Add password suggestions if they exist and were requested. // Add password suggestions if they exist and were requested.
if (show_password_suggestions && fill_data_) { 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(), show_all_passwords.value(), for_password_field.value(),
&suggestions); &suggestions);
} }
......
...@@ -114,9 +114,9 @@ class PasswordAutofillManager : public autofill::AutofillPopupDelegate { ...@@ -114,9 +114,9 @@ class PasswordAutofillManager : public autofill::AutofillPopupDelegate {
// Builds the suggestions used to show or update the autofill popup. // Builds the suggestions used to show or update the autofill popup.
std::vector<autofill::Suggestion> BuildSuggestions( std::vector<autofill::Suggestion> BuildSuggestions(
ShowAllPasswords show_all_passwords, const base::string16& username_filter,
ForPasswordField for_password_field, ForPasswordField for_password_field,
const base::string16& typed_username, ShowAllPasswords show_all_passwords,
OffersGeneration for_generation, OffersGeneration for_generation,
ShowPasswordSuggestions show_password_suggestions); 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