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

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

Issue 462563002: Add ManagePasswordsBubbleManageViewController and unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix views Created 6 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 | « chrome/browser/ui/passwords/manage_passwords_bubble_model.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c67f904d2432082c832f4f7814af77cd5bc2f1fb..db254862d4e3873d28c82da5ce69eff1b51523c9 100644
--- a/chrome/browser/ui/views/passwords/manage_password_item_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_password_item_view.cc
@@ -18,23 +18,9 @@
namespace {
-enum FieldType { USERNAME_FIELD, PASSWORD_FIELD };
-
-// Upper limit on the size of the username and password fields.
-const int kUsernameFieldSize = 30;
-const int kPasswordFieldSize = 22;
-
-// Returns the width of |type| field.
-int GetFieldWidth(FieldType type) {
- return ui::ResourceBundle::GetSharedInstance()
- .GetFontList(ui::ResourceBundle::SmallFont)
- .GetExpectedTextWidth(type == USERNAME_FIELD ? kUsernameFieldSize
- : kPasswordFieldSize);
-}
-
int FirstFieldWidth() {
return std::max(
- GetFieldWidth(USERNAME_FIELD),
+ ManagePasswordsBubbleModel::UsernameFieldWidth(),
views::Label(l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_DELETED))
.GetPreferredSize()
.width());
@@ -42,7 +28,7 @@ int FirstFieldWidth() {
int SecondFieldWidth() {
return std::max(
- GetFieldWidth(PASSWORD_FIELD),
+ ManagePasswordsBubbleModel::PasswordFieldWidth(),
views::Label(l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_UNDO))
.GetPreferredSize()
.width());
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_bubble_model.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698