Chromium Code Reviews| 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 2b1886ba47715113b72aec892c0e5ea8891ddfb7..5e706b421dd8570121b57f08e1e0c63d34ba55c4 100644 |
| --- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
| +++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
| @@ -14,6 +14,7 @@ |
| #include "chrome/browser/ui/passwords/save_password_refusal_combobox_model.h" |
| #include "chrome/browser/ui/views/frame/browser_view.h" |
| #include "chrome/browser/ui/views/passwords/credentials_item_view.h" |
| +#include "chrome/browser/ui/views/passwords/manage_credential_item_view.h" |
| #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" |
| #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" |
| #include "chrome/grit/generated_resources.h" |
| @@ -697,6 +698,42 @@ void ManagePasswordsBubbleView::ManageView::LinkClicked(views::Link* source, |
| parent_->Close(); |
| } |
| +// ManagePasswordsBubbleView::ManageAccountsView ------------------------------ |
| + |
| +// A view offering the user a list of his currently saved through the Credential |
| +// Manager API accounts for the current page. |
| +class ManagePasswordsBubbleView::ManageAccountsView : public views::View { |
| + public: |
| + explicit ManageAccountsView(ManagePasswordsBubbleView* parent); |
| + |
| + private: |
| + ManagePasswordsBubbleView* parent_; |
| +}; |
| + |
| +ManagePasswordsBubbleView::ManageAccountsView::ManageAccountsView( |
| + ManagePasswordsBubbleView* parent) |
| + : parent_(parent) { |
| + views::GridLayout* layout = new views::GridLayout(this); |
| + layout->set_minimum_size(gfx::Size(kDesiredBubbleWidth, 0)); |
| + SetLayoutManager(layout); |
| + |
| + // Add the title. |
| + BuildColumnSet(layout, SINGLE_VIEW_COLUMN_SET); |
| + AddTitleRow(layout, parent_->model()); |
| + |
| + net::URLRequestContextGetter* request_context = |
| + parent_->model()->GetProfile()->GetRequestContext(); |
| + for (auto* form : parent_->model()->local_pending_credentials()) { |
|
Mike West
2015/02/20 16:21:39
Nit: This is just `autofill::PasswordForm*`, right
vasilii
2015/02/20 16:58:51
Done.
|
| + // Add the title to the layout with appropriate padding. |
| + layout->StartRow(0, SINGLE_VIEW_COLUMN_SET); |
| + layout->AddView( |
| + new ManageCredentialItemView(parent_->model(), form, request_context)); |
| + } |
| + |
| + // Extra padding for visual awesomeness. |
| + layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| +} |
| + |
| // ManagePasswordsBubbleView::BlacklistedView --------------------------------- |
| // A view offering the user the ability to re-enable the password manager for |