| Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
|
| diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
|
| index 3238816c32e1196fcbf7d89b5592fdac6f639767..7024fbe52af89b63610282ce602fa69c12db2746 100644
|
| --- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
|
| +++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
|
| @@ -209,12 +209,9 @@ ManagePasswordsBubbleView::AccountChooserView::AccountChooserView(
|
| BuildColumnSet(layout, SINGLE_VIEW_COLUMN_SET);
|
| AddTitleRow(layout, parent_->model());
|
|
|
| - // TODO(vasilii): this is a stub instead of actual data. We temporary show 2
|
| - // credentials.
|
| - for (int i = 0; i < 2; ++i) {
|
| - base::string16 name =
|
| - l10n_util::GetStringFUTF16Int(IDS_NUMBERED_PROFILE_NAME, i);
|
| - CredentialsItemView* credential_view = new CredentialsItemView(this, name);
|
| + const auto& pending_credentials = parent_->model()->pending_credentials();
|
| + for (autofill::PasswordForm* form : pending_credentials) {
|
| + CredentialsItemView* credential_view = new CredentialsItemView(this, *form);
|
| // Add the title to the layout with appropriate padding.
|
| layout->StartRow(0, SINGLE_VIEW_COLUMN_SET);
|
| layout->AddView(credential_view);
|
| @@ -237,6 +234,12 @@ ManagePasswordsBubbleView::AccountChooserView::~AccountChooserView() {
|
|
|
| void ManagePasswordsBubbleView::AccountChooserView::ButtonPressed(
|
| views::Button* sender, const ui::Event& event) {
|
| + if (sender == cancel_button_) {
|
| + parent_->model()->OnChooseCredetials(false, autofill::PasswordForm());
|
| + } else {
|
| + CredentialsItemView* view = static_cast<CredentialsItemView*>(sender);
|
| + parent_->model()->OnChooseCredetials(true, view->form());
|
| + }
|
| parent_->Close();
|
| }
|
|
|
| @@ -281,7 +284,7 @@ ManagePasswordsBubbleView::PendingView::PendingView(
|
| // Create the pending credential item, save button and refusal combobox.
|
| ManagePasswordItemView* item =
|
| new ManagePasswordItemView(parent->model(),
|
| - parent->model()->pending_credentials(),
|
| + parent->model()->pending_password(),
|
| password_manager::ui::FIRST_ITEM);
|
| save_button_ = new views::BlueButton(
|
| this, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SAVE_BUTTON));
|
| @@ -888,6 +891,9 @@ void ManagePasswordsBubbleView::Refresh() {
|
| AddChildView(new BlacklistedView(this));
|
| } else if (model()->state() == password_manager::ui::CONFIRMATION_STATE) {
|
| AddChildView(new SaveConfirmationView(this));
|
| + } else if (model()->state() ==
|
| + password_manager::ui::PENDING_CREDENTIALS_AND_BUBBLE_STATE) {
|
| + AddChildView(new AccountChooserView(this));
|
| } else {
|
| AddChildView(new ManageView(this));
|
| }
|
|
|