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

Unified Diff: ui/views/controls/styled_label.cc

Issue 12317109: Add a dialog for getting user consent in the echo redeem flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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: ui/views/controls/styled_label.cc
diff --git a/ui/views/controls/styled_label.cc b/ui/views/controls/styled_label.cc
index f875c7f36c68e6d35158e670d08c27ac97ff2cde..f377c7da52f98ca4f2cf01432b965d9c958835d0 100644
--- a/ui/views/controls/styled_label.cc
+++ b/ui/views/controls/styled_label.cc
@@ -46,6 +46,11 @@ void StyledLabel::AddLink(const ui::Range& range) {
InvalidateLayout();
}
+void StyledLabel::SizeToFit(int width) {
sky 2013/03/18 19:32:39 I'm not a fan of this method, it's too easy to use
tbarzic 2013/03/18 20:40:03 ok, removed
+ SetBounds(x(), y(), width, GetHeightForWidth(width));
+ InvalidateLayout();
+}
+
gfx::Insets StyledLabel::GetInsets() const {
gfx::Insets insets = View::GetInsets();
const gfx::Insets focus_border_padding(1, 1, 1, 1);
@@ -53,6 +58,10 @@ gfx::Insets StyledLabel::GetInsets() const {
return insets;
}
+gfx::Size StyledLabel::GetPreferredSize() {
+ return gfx::Size(width(), GetHeightForWidth(width()));
sky 2013/03/18 19:32:39 This isn't right. If you need the preferred size f
tbarzic 2013/03/18 20:40:03 Done.
+}
+
int StyledLabel::GetHeightForWidth(int w) {
if (w != calculated_size_.width())
calculated_size_ = gfx::Size(w, CalculateAndDoLayout(w, true));

Powered by Google App Engine
This is Rietveld 408576698