summaryrefslogtreecommitdiffstats
path: root/ui/views/view.h
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-20 17:24:44 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-20 17:24:44 +0000
commite1b62b7f2241bc2feb8696a9f65e46438dbce64b (patch)
treef1c6d45056b7e78e54604054dbd68f14197ad9cd /ui/views/view.h
parentc0858c55fec87318cabb97fe28bcd3e93578c0ee (diff)
downloadchromium_src-e1b62b7f2241bc2feb8696a9f65e46438dbce64b.zip
chromium_src-e1b62b7f2241bc2feb8696a9f65e46438dbce64b.tar.gz
chromium_src-e1b62b7f2241bc2feb8696a9f65e46438dbce64b.tar.bz2
views: Make view::Views::GetPreferredSize() const.
Due to button refactoring patches, we now need to ask views for their preferred sizes in const methods. Across the entire codebase, the overwhelming majority of GetPreferredSize() implementations could be const. There are only a few places where we can't, and they are usually combining the sizing and layout code. BookmarksBarView was simple enough to perform this separation. Most of the other places were solved by adding "mutable" to value caches. BUG=155363 R=jam@chromium.org, pkasting@chromium.org, scheib@chromium.org, sky@chromium.org, pkasting, sky TBR=jam, scheib Review URL: https://codereview.chromium.org/273223002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271682 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/view.h')
-rw-r--r--ui/views/view.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/views/view.h b/ui/views/view.h
index f26d8f0..5f2f6c9 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -265,14 +265,14 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
virtual int GetBaseline() const;
// Get the size the View would like to be, if enough space were available.
- virtual gfx::Size GetPreferredSize();
+ virtual gfx::Size GetPreferredSize() const;
// Convenience method that sizes this view to its preferred size.
void SizeToPreferredSize();
// Gets the minimum size of the view. View's implementation invokes
// GetPreferredSize.
- virtual gfx::Size GetMinimumSize();
+ virtual gfx::Size GetMinimumSize() const;
// Gets the maximum size of the view. Currently only used for sizing shell
// windows.
@@ -282,7 +282,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// View's implementation returns the value from getPreferredSize.cy.
// Override if your View's preferred height depends upon the width (such
// as with Labels).
- virtual int GetHeightForWidth(int w);
+ virtual int GetHeightForWidth(int w) const;
// Set whether this view is visible. Painting is scheduled as needed.
virtual void SetVisible(bool visible);