| Index: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
|
| diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
|
| index beb3495ebe9156e24fe8c5212d1a5c316036d23e..66ed924d8a04f8d514e4bc30f2fb374a2317cd4f 100644
|
| --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
|
| +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
|
| @@ -99,22 +99,27 @@ bool ManagePasswordsUIController::OnChooseCredentials(
|
| std::vector<std::unique_ptr<autofill::PasswordForm>> federated_credentials,
|
| const GURL& origin,
|
| const ManagePasswordsState::CredentialsCallback& callback) {
|
| - DCHECK(!local_credentials.empty() || !federated_credentials.empty());
|
| + DCHECK(!local_credentials.empty());
|
| if (!HasBrowserWindow())
|
| return false;
|
| - PasswordDialogController::FormsVector locals =
|
| - CopyFormVector(local_credentials);
|
| + // If |local_credentials| contains PSL matches they shouldn't be propagated to
|
| + // the state because PSL matches aren't saved for current page. This logic is
|
| + // implemented here because Android uses ManagePasswordsState as a data source
|
| + // for account chooser.
|
| + PasswordDialogController::FormsVector locals;
|
| + if (!local_credentials[0]->is_public_suffix_match)
|
| + locals = CopyFormVector(local_credentials);
|
| PasswordDialogController::FormsVector federations =
|
| CopyFormVector(federated_credentials);
|
| passwords_data_.OnRequestCredentials(
|
| - std::move(local_credentials), std::move(federated_credentials), origin);
|
| + std::move(locals), std::move(federations), origin);
|
| passwords_data_.set_credentials_callback(callback);
|
| dialog_controller_.reset(new PasswordDialogControllerImpl(
|
| Profile::FromBrowserContext(web_contents()->GetBrowserContext()),
|
| this));
|
| dialog_controller_->ShowAccountChooser(
|
| CreateAccountChooser(dialog_controller_.get()),
|
| - std::move(locals), std::move(federations));
|
| + std::move(local_credentials), std::move(federated_credentials));
|
| UpdateBubbleAndIconVisibility();
|
| return true;
|
| }
|
|
|