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

Unified Diff: chrome/browser/ui/views/autofill/decorated_textfield.cc

Issue 140653004: Update DecoratedTextfield layout on icon changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update Layout on DecoratedTextfield icon changes. Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autofill/decorated_textfield.cc
diff --git a/chrome/browser/ui/views/autofill/decorated_textfield.cc b/chrome/browser/ui/views/autofill/decorated_textfield.cc
index 94e8202c7655ffbb8edc403a80d7b34dd58294a8..74361ce15bb5080e106dc90a295c976690ca02d5 100644
--- a/chrome/browser/ui/views/autofill/decorated_textfield.cc
+++ b/chrome/browser/ui/views/autofill/decorated_textfield.cc
@@ -144,27 +144,13 @@ void DecoratedTextfield::UpdateBorder() {
border->SetColor(kWarningColor);
else if (!editable_)
border->SetColor(SK_ColorTRANSPARENT);
-
- const gfx::Insets insets = GetInsets();
- int left = icon_view_ ?
- icon_view_->GetPreferredSize().width() + 2 * kTextfieldIconPadding : 0;
- int right = 0;
- if (base::i18n::IsRTL())
- std::swap(left, right);
- border->SetInsets(insets.top(), insets.left() + left, insets.bottom(),
- insets.right() + right);
set_border(border);
}
void DecoratedTextfield::IconChanged() {
// Don't show the icon if nothing else is showing.
- const bool visible = editable_ || !text().empty();
- if (icon_view_->visible() == visible)
Evan Stade 2014/01/16 20:40:43 why remove this?
msw 2014/01/16 21:10:33 It seems to be necessary. I tried to dig in and un
- return;
-
- icon_view_->SetVisible(visible);
- UpdateBorder();
- SchedulePaint();
+ icon_view_->SetVisible(editable_ || !text().empty());
+ Layout();
}
} // namespace autofill
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698