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

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

Issue 221003002: Password bubble: Lock displayed password length to 15 characters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: chrome/browser/ui/views/passwords/manage_password_item_view.cc
diff --git a/chrome/browser/ui/views/passwords/manage_password_item_view.cc b/chrome/browser/ui/views/passwords/manage_password_item_view.cc
index e864a8b930fd4bf3db1641fa08154cb6e12670c0..f2312e1f0dd82e13cc7571aae3b551cc290ee77b 100644
--- a/chrome/browser/ui/views/passwords/manage_password_item_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_password_item_view.cc
@@ -42,8 +42,7 @@ ManagePasswordItemView::ManagePasswordItemView(
layout->AddView(label_1_);
// Add the password field: fills the second non-padding column of the layout.
- label_2_ =
- new views::Link(GetPasswordDisplayString(password_form_.password_value));
+ label_2_ = new views::Link(GetPasswordDisplayString());
label_2_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
label_2_->set_listener(this);
label_2_->SetFocusable(false);
@@ -103,12 +102,9 @@ void ManagePasswordItemView::BuildColumnSet(views::GridLayout* layout,
}
// static
-base::string16 ManagePasswordItemView::GetPasswordDisplayString(
- const base::string16& password) {
+base::string16 ManagePasswordItemView::GetPasswordDisplayString() {
const wchar_t kPasswordBullet = 0x2022;
- const size_t kMaxPasswordChar = 22;
- return base::string16(std::min(password.length(), kMaxPasswordChar),
- kPasswordBullet);
+ return base::string16(15, kPasswordBullet);
}
ManagePasswordItemView::~ManagePasswordItemView() {
@@ -142,7 +138,7 @@ void ManagePasswordItemView::Refresh() {
// Set the password string to the appropriate number of bullets, and
// disable the link.
- label_2_->SetText(GetPasswordDisplayString(password_form_.password_value));
+ label_2_->SetText(GetPasswordDisplayString());
label_2_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
label_2_->SetEnabled(false);

Powered by Google App Engine
This is Rietveld 408576698