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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

Issue 1271283002: Change password form UI for no accounts stored case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cpf_ui
Patch Set: Fix tests Created 5 years, 4 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
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_form_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1b54aa965922ab2ae15b5485598d4e37d6eddcab..e2d9554412aaa8cdd5f74ef9ac91d518b7cdd0aa 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -393,11 +393,14 @@ ManagePasswordsBubbleView::PendingView::PendingView(
layout->set_minimum_size(gfx::Size(kDesiredBubbleWidth, 0));
SetLayoutManager(layout);
- std::vector<const autofill::PasswordForm*> credentials(
- 1, &parent->model()->pending_password());
// Create the pending credential item, save button and refusal combobox.
- ManagePasswordItemsView* item =
- new ManagePasswordItemsView(parent_->model(), credentials);
+ ManagePasswordItemsView* item = nullptr;
+ if (!parent->model()->pending_password()
+ .IsPossibleChangePasswordFormWithoutUsername()) {
+ std::vector<const autofill::PasswordForm*> credentials(
+ 1, &parent->model()->pending_password());
+ item = new ManagePasswordItemsView(parent_->model(), credentials);
+ }
save_button_ = new views::BlueButton(
this, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SAVE_BUTTON));
save_button_->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList(
@@ -426,8 +429,10 @@ ManagePasswordsBubbleView::PendingView::PendingView(
layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
// Credential row.
- layout->StartRow(0, SINGLE_VIEW_COLUMN_SET);
- layout->AddView(item);
+ if (item) {
+ layout->StartRow(0, SINGLE_VIEW_COLUMN_SET);
+ layout->AddView(item);
+ }
// Button row.
BuildColumnSet(layout, DOUBLE_BUTTON_COLUMN_SET);
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_form_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698