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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 14053015: Don't add subtext padding if there is no subpadding. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing Comments Created 7 years, 8 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/autofill/autofill_popup_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
index e310f8a1eb546f238146986b5f0bb387e4fe10c0..0be00d1f8ea3db91c0f0e13f453330f90ff39eab 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -39,14 +39,11 @@ const size_t kRowHeight = 24;
// The vertical height of a separator in pixels.
const size_t kSeparatorHeight = 1;
-// The amount of minimum padding between the Autofill name and subtext in
-// pixels.
-const size_t kNamePadding = 15;
-
// The maximum amount of characters to display from either the name or subtext.
const size_t kMaxTextLength = 15;
#if !defined(OS_ANDROID)
+const size_t kNamePadding = AutofillPopupView::kNamePadding;
const size_t kIconPadding = AutofillPopupView::kIconPadding;
const size_t kEndPadding = AutofillPopupView::kEndPadding;
const size_t kAutofillIconWidth = AutofillPopupView::kAutofillIconWidth;
@@ -501,7 +498,10 @@ int AutofillPopupControllerImpl::GetDesiredPopupHeight() const {
}
int AutofillPopupControllerImpl::RowWidthWithoutText(int row) const {
- int row_size = kEndPadding + kNamePadding;
+ int row_size = kEndPadding;
+
+ if (!subtexts_[row].empty())
+ row_size += kNamePadding;
// Add the Autofill icon size, if required.
if (!icons_[row].empty())

Powered by Google App Engine
This is Rietveld 408576698