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

Unified Diff: ui/views/controls/label.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/image_view.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.h
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h
index 17251f3528b89f080d6d62ef076504d886c84649..45f01988018f59bb311a3fa425be0ceb35fb272c 100644
--- a/ui/views/controls/label.h
+++ b/ui/views/controls/label.h
@@ -176,13 +176,13 @@ class VIEWS_EXPORT Label : public View {
virtual gfx::Insets GetInsets() const OVERRIDE;
virtual int GetBaseline() const OVERRIDE;
// Overridden to compute the size required to display this label.
- virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const OVERRIDE;
// Returns the width of an ellipsis if the label is non-empty, or 0 otherwise.
- virtual gfx::Size GetMinimumSize() OVERRIDE;
+ virtual gfx::Size GetMinimumSize() const OVERRIDE;
// Returns the height necessary to display this label with the provided width.
// This method is used to layout multi-line labels. It is equivalent to
// GetPreferredSize().height() if the receiver is not multi-line.
- virtual int GetHeightForWidth(int w) OVERRIDE;
+ virtual int GetHeightForWidth(int w) const OVERRIDE;
virtual const char* GetClassName() const OVERRIDE;
virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) OVERRIDE;
virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE;
@@ -297,8 +297,8 @@ class VIEWS_EXPORT Label : public View {
bool has_shadow_;
// The cached heights to avoid recalculation in GetHeightForWidth().
- std::vector<gfx::Size> cached_heights_;
- int cached_heights_cursor_;
+ mutable std::vector<gfx::Size> cached_heights_;
+ mutable int cached_heights_cursor_;
DISALLOW_COPY_AND_ASSIGN(Label);
};
« no previous file with comments | « ui/views/controls/image_view.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698