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

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

Issue 1992633003: Add "Sign In" button to the account chooser on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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/password_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/passwords/password_dialog_controller_impl.cc b/chrome/browser/ui/passwords/password_dialog_controller_impl.cc
index 09f21aee96c0852cf6f56fb7f018812950474206..6eb80c570bee2a571ff8645ded44a46faa44e2d0 100644
--- a/chrome/browser/ui/passwords/password_dialog_controller_impl.cc
+++ b/chrome/browser/ui/passwords/password_dialog_controller_impl.cc
@@ -84,6 +84,10 @@ PasswordDialogControllerImpl::GetAccoutChooserTitle() const {
return result;
}
+bool PasswordDialogControllerImpl::ShouldShowSignInButton() const {
+ return local_credentials_.size() == 1;
+}
+
base::string16 PasswordDialogControllerImpl::GetAutoSigninPromoTitle() const {
int message_id = IsSyncingAutosignSetting(profile_)
? IDS_AUTO_SIGNIN_FIRST_RUN_TITLE_MANY_DEVICES
@@ -114,6 +118,16 @@ void PasswordDialogControllerImpl::OnChooseCredentials(
delegate_->ChooseCredential(password_form, credential_type);
}
+void PasswordDialogControllerImpl::OnSignInClicked() {
+ DCHECK_EQ(1u, local_credentials_.size());
+ password_manager::metrics_util::LogAccountChooserUserAction(
+ password_manager::metrics_util::ACCOUNT_CHOOSER_SIGN_IN);
+ ResetDialog();
+ delegate_->ChooseCredential(
+ *local_credentials_[0],
+ password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD);
+}
+
void PasswordDialogControllerImpl::OnAutoSigninOK() {
password_bubble_experiment::RecordAutoSignInPromptFirstRunExperienceWasShown(
profile_->GetPrefs());

Powered by Google App Engine
This is Rietveld 408576698