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

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

Issue 578593002: Password bubble: get rid of hardcodeded sizes for username and password. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't touch model Created 6 years, 3 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/views/passwords/manage_password_item_view.h ('k') | no next file » | 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 8ddac6f9af07d6a0e2f6d669fd775affdc341936..1deec761b70e85a89c6fc7d71dd3719a029e4918 100644
--- a/chrome/browser/ui/views/passwords/manage_password_item_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_password_item_view.cc
@@ -21,23 +21,10 @@
namespace {
-int FirstFieldWidth() {
- return std::max(
- ManagePasswordsBubbleModel::UsernameFieldWidth(),
- views::Label(l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_DELETED))
- .GetPreferredSize()
- .width());
-}
-
-int SecondFieldWidth() {
- return std::max(
- ManagePasswordsBubbleModel::PasswordFieldWidth(),
- views::Label(l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_UNDO))
- .GetPreferredSize()
- .width());
-}
-
-enum ColumnSets { TWO_COLUMN_SET = 0, THREE_COLUMN_SET };
+enum ColumnSets {
+ TWO_COLUMN_SET,
+ THREE_COLUMN_SET
+};
void BuildColumnSet(views::GridLayout* layout, int column_set_id) {
views::ColumnSet* column_set = layout->AddColumnSet(column_set_id);
@@ -46,10 +33,10 @@ void BuildColumnSet(views::GridLayout* layout, int column_set_id) {
column_set->AddPaddingColumn(0, views::kItemLabelSpacing);
column_set->AddColumn(views::GridLayout::FILL,
views::GridLayout::FILL,
+ 2,
+ views::GridLayout::USE_PREF,
0,
- views::GridLayout::FIXED,
- FirstFieldWidth(),
- FirstFieldWidth());
Mike West 2014/09/16 15:20:42 Hrm. How does this end up looking? I'm worried abo
+ 0);
// The password/"Undo!" field.
column_set->AddPaddingColumn(0, views::kItemLabelSpacing);
@@ -57,8 +44,8 @@ void BuildColumnSet(views::GridLayout* layout, int column_set_id) {
views::GridLayout::FILL,
1,
views::GridLayout::USE_PREF,
- SecondFieldWidth(),
- SecondFieldWidth());
+ 0,
+ 0);
// If we're in manage-mode, we need another column for the delete button.
if (column_set_id == THREE_COLUMN_SET) {
@@ -222,7 +209,7 @@ void ManagePasswordItemView::UndoView::LinkClicked(views::Link* sender,
// ManagePasswordItemView
ManagePasswordItemView::ManagePasswordItemView(
ManagePasswordsBubbleModel* manage_passwords_bubble_model,
- autofill::PasswordForm password_form,
+ const autofill::PasswordForm& password_form,
password_manager::ui::PasswordItemPosition position)
: model_(manage_passwords_bubble_model),
password_form_(password_form),
« no previous file with comments | « chrome/browser/ui/views/passwords/manage_password_item_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698