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

Unified Diff: ui/views/controls/button/text_button.h

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | « ui/views/controls/button/menu_button.cc ('k') | ui/views/controls/button/text_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/text_button.h
diff --git a/ui/views/controls/button/text_button.h b/ui/views/controls/button/text_button.h
index 209d6e116af4e3d1ccbc55282b2334fb15b0c80b..49c4f3f8c17287d2be6e80416b46674294b05df3 100644
--- a/ui/views/controls/button/text_button.h
+++ b/ui/views/controls/button/text_button.h
@@ -161,9 +161,9 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton,
virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode);
// Overridden from View:
- virtual gfx::Size GetPreferredSize() OVERRIDE;
- virtual gfx::Size GetMinimumSize() OVERRIDE;
- virtual int GetHeightForWidth(int w) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const OVERRIDE;
+ virtual int GetHeightForWidth(int w) const OVERRIDE;
virtual void OnEnabledChanged() OVERRIDE;
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
@@ -182,7 +182,7 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton,
void UpdateTextSize();
// Calculate the size of the text size without setting any of the members.
- void CalculateTextSize(gfx::Size* text_size, int max_width);
+ void CalculateTextSize(gfx::Size* text_size, int max_width) const;
// Paint the button's text into the specified canvas. If |mode| is
// |PB_FOR_DRAG|, the function paints a drag image representation. Derived
@@ -233,7 +233,7 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton,
base::string16 text_;
// The size of the text string.
- gfx::Size text_size_;
+ mutable gfx::Size text_size_;
// Track the size of the largest text string seen so far, so that
// changing text_ will not resize the button boundary.
@@ -326,7 +326,7 @@ class VIEWS_EXPORT TextButton : public TextButtonBase {
void set_full_justification(bool full_justification);
// Overridden from View:
- virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const OVERRIDE;
virtual const char* GetClassName() const OVERRIDE;
// Overridden from TextButtonBase:
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/controls/button/text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698