| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" |
| 6 | 6 |
| 7 #include <numeric> | 7 #include <numeric> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 new views::Label(GetDisplayUsername(form))); | 72 new views::Label(GetDisplayUsername(form))); |
| 73 label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( | 73 label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( |
| 74 ui::ResourceBundle::SmallFont)); | 74 ui::ResourceBundle::SmallFont)); |
| 75 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 75 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 76 return label; | 76 return label; |
| 77 } | 77 } |
| 78 | 78 |
| 79 std::unique_ptr<views::Label> GeneratePasswordLabel( | 79 std::unique_ptr<views::Label> GeneratePasswordLabel( |
| 80 const autofill::PasswordForm& form) { | 80 const autofill::PasswordForm& form) { |
| 81 base::string16 text = | 81 base::string16 text = |
| 82 form.federation_origin.unique() | 82 form.federation_origin.opaque() |
| 83 ? form.password_value | 83 ? form.password_value |
| 84 : l10n_util::GetStringFUTF16( | 84 : l10n_util::GetStringFUTF16( |
| 85 IDS_PASSWORDS_VIA_FEDERATION, | 85 IDS_PASSWORDS_VIA_FEDERATION, |
| 86 base::UTF8ToUTF16(form.federation_origin.host())); | 86 base::UTF8ToUTF16(form.federation_origin.host())); |
| 87 std::unique_ptr<views::Label> label(new views::Label(text)); | 87 std::unique_ptr<views::Label> label(new views::Label(text)); |
| 88 label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( | 88 label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( |
| 89 ui::ResourceBundle::SmallFont)); | 89 ui::ResourceBundle::SmallFont)); |
| 90 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 90 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 91 if (form.federation_origin.unique()) | 91 if (form.federation_origin.opaque()) |
| 92 label->SetObscured(true); | 92 label->SetObscured(true); |
| 93 return label; | 93 return label; |
| 94 } | 94 } |
| 95 | 95 |
| 96 std::unique_ptr<views::ImageButton> GenerateDeleteButton( | 96 std::unique_ptr<views::ImageButton> GenerateDeleteButton( |
| 97 views::ButtonListener* listener) { | 97 views::ButtonListener* listener) { |
| 98 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 98 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 99 std::unique_ptr<views::ImageButton> button(new views::ImageButton(listener)); | 99 std::unique_ptr<views::ImageButton> button(new views::ImageButton(listener)); |
| 100 button->SetImage(views::ImageButton::STATE_NORMAL, | 100 button->SetImage(views::ImageButton::STATE_NORMAL, |
| 101 rb->GetImageNamed(IDR_CLOSE_2).ToImageSkia()); | 101 rb->GetImageNamed(IDR_CLOSE_2).ToImageSkia()); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 deleted | 308 deleted |
| 309 ? ManagePasswordsBubbleModel::REMOVE_PASSWORD | 309 ? ManagePasswordsBubbleModel::REMOVE_PASSWORD |
| 310 : ManagePasswordsBubbleModel::ADD_PASSWORD); | 310 : ManagePasswordsBubbleModel::ADD_PASSWORD); |
| 311 } | 311 } |
| 312 | 312 |
| 313 void ManagePasswordItemsView::Refresh() { | 313 void ManagePasswordItemsView::Refresh() { |
| 314 DCHECK_NE(password_manager::ui::PENDING_PASSWORD_STATE, model_->state()); | 314 DCHECK_NE(password_manager::ui::PENDING_PASSWORD_STATE, model_->state()); |
| 315 RemoveAllChildViews(true); | 315 RemoveAllChildViews(true); |
| 316 AddRows(); | 316 AddRows(); |
| 317 } | 317 } |
| OLD | NEW |