Chromium Code Reviews| Index: chrome/browser/ui/views/passwords/manage_password_items_view.cc |
| diff --git a/chrome/browser/ui/views/passwords/manage_password_items_view.cc b/chrome/browser/ui/views/passwords/manage_password_items_view.cc |
| index 6ccdd2ccf2d92a7b38829bc03fbb36453b4dd270..a6165ec8d3965abbb5062161265c8a975a16b341 100644 |
| --- a/chrome/browser/ui/views/passwords/manage_password_items_view.cc |
| +++ b/chrome/browser/ui/views/passwords/manage_password_items_view.cc |
| @@ -14,6 +14,7 @@ |
| #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
| #include "chrome/browser/ui/views/harmony/chrome_typography.h" |
| #include "chrome/grit/generated_resources.h" |
| +#include "components/password_manager/core/common/password_manager_ui.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/resources/grit/ui_resources.h" |
| @@ -22,6 +23,7 @@ |
| #include "ui/views/controls/label.h" |
| #include "ui/views/controls/link.h" |
| #include "ui/views/controls/link_listener.h" |
| +#include "ui/views/controls/textfield/textfield.h" |
| #include "ui/views/layout/fill_layout.h" |
| #include "ui/views/layout/grid_layout.h" |
| @@ -33,6 +35,36 @@ enum ColumnSets { |
| THREE_COLUMN_SET |
| }; |
| +std::unique_ptr<views::Label> GenerateUsernameLabel( |
|
vasilii
2017/07/03 17:15:30
You should move them out of the anonymous namespac
irmakk
2017/07/06 10:42:46
Done.
|
| + const autofill::PasswordForm& form) { |
| + auto label = base::MakeUnique<views::Label>(GetDisplayUsername(form), |
| + CONTEXT_DEPRECATED_SMALL); |
| + label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| + return label; |
| +} |
| + |
| +std::unique_ptr<views::Textfield> GenerateUsernameEditable( |
| + const autofill::PasswordForm& form) { |
| + auto editable = base::MakeUnique<views::Textfield>(); |
| + editable->SetText(GetDisplayUsername(form)); |
|
vasilii
2017/07/03 17:15:31
I don't think we should fill <no username> there.
irmakk
2017/07/06 10:42:46
Done.
|
| + return editable; |
| +} |
| + |
| +std::unique_ptr<views::Label> GeneratePasswordLabel( |
| + const autofill::PasswordForm& form) { |
| + base::string16 text = |
| + form.federation_origin.unique() |
| + ? form.password_value |
| + : l10n_util::GetStringFUTF16( |
| + IDS_PASSWORDS_VIA_FEDERATION, |
| + base::UTF8ToUTF16(form.federation_origin.host())); |
| + auto label = base::MakeUnique<views::Label>(text, CONTEXT_DEPRECATED_SMALL); |
| + label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| + if (form.federation_origin.unique()) |
| + label->SetObscured(true); |
| + return label; |
| +} |
| + |
| void BuildColumnSetIfNeeded(views::GridLayout* layout, int column_set_id) { |
| if (layout->GetColumnSet(column_set_id)) |
| return; |
| @@ -70,29 +102,6 @@ void BuildColumnSetIfNeeded(views::GridLayout* layout, int column_set_id) { |
| } |
| } |
| -std::unique_ptr<views::Label> GenerateUsernameLabel( |
| - const autofill::PasswordForm& form) { |
| - auto label = base::MakeUnique<views::Label>(GetDisplayUsername(form), |
| - CONTEXT_DEPRECATED_SMALL); |
| - label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| - return label; |
| -} |
| - |
| -std::unique_ptr<views::Label> GeneratePasswordLabel( |
| - const autofill::PasswordForm& form) { |
| - base::string16 text = |
| - form.federation_origin.unique() |
| - ? form.password_value |
| - : l10n_util::GetStringFUTF16( |
| - IDS_PASSWORDS_VIA_FEDERATION, |
| - base::UTF8ToUTF16(form.federation_origin.host())); |
| - auto label = base::MakeUnique<views::Label>(text, CONTEXT_DEPRECATED_SMALL); |
| - label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| - if (form.federation_origin.unique()) |
| - label->SetObscured(true); |
| - return label; |
| -} |
| - |
| std::unique_ptr<views::ImageButton> GenerateDeleteButton( |
| views::ButtonListener* listener) { |
| ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |