Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc

Issue 2529093002: Hide PSL matches in the password bubble after the account chooser. (Closed)
Patch Set: Created 4 years, 1 month 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: 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;
}

Powered by Google App Engine
This is Rietveld 408576698