diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-20 17:24:44 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-20 17:24:44 +0000 |
commit | e1b62b7f2241bc2feb8696a9f65e46438dbce64b (patch) | |
tree | f1c6d45056b7e78e54604054dbd68f14197ad9cd /ash/shelf/shelf_view.h | |
parent | c0858c55fec87318cabb97fe28bcd3e93578c0ee (diff) | |
download | chromium_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 'ash/shelf/shelf_view.h')
-rw-r--r-- | ash/shelf/shelf_view.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h index 9f7c2dd..d909d91 100644 --- a/ash/shelf/shelf_view.h +++ b/ash/shelf/shelf_view.h @@ -169,7 +169,7 @@ class ASH_EXPORT ShelfView : public views::View, // Calculates the ideal bounds. The bounds of each button corresponding to an // item in the model is set in |view_model_|. - void CalculateIdealBounds(IdealBounds* bounds); + void CalculateIdealBounds(IdealBounds* bounds) const; // Returns the index of the last view whose max primary axis coordinate is // less than |max_value|. Returns -1 if nothing fits, or there are no views. @@ -203,7 +203,7 @@ class ASH_EXPORT ShelfView : public views::View, void FinalizeRipOffDrag(bool cancel); // Check if an item can be ripped off or not. - RemovableState RemovableByRipOff(int index); + RemovableState RemovableByRipOff(int index) const; // Returns true if |typea| and |typeb| should be in the same drag range. bool SameDragType(ShelfItemType typea, ShelfItemType typeb) const; @@ -238,10 +238,10 @@ class ASH_EXPORT ShelfView : public views::View, void StartFadeInLastVisibleItem(); // Updates the visible range of overflow items in |overflow_view|. - void UpdateOverflowRange(ShelfView* overflow_view); + void UpdateOverflowRange(ShelfView* overflow_view) const; // Overridden from views::View: - virtual gfx::Size GetPreferredSize() OVERRIDE; + virtual gfx::Size GetPreferredSize() const OVERRIDE; virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; virtual FocusTraversable* GetPaneFocusTraversable() OVERRIDE; virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; @@ -334,7 +334,7 @@ class ASH_EXPORT ShelfView : public views::View, // Last index of a launcher button that is visible // (does not go into overflow). - int last_visible_index_; + mutable int last_visible_index_; scoped_ptr<views::BoundsAnimator> bounds_animator_; @@ -380,7 +380,7 @@ class ASH_EXPORT ShelfView : public views::View, // Index of the last hidden launcher item. If there are no hidden items this // will be equal to last_visible_index_ + 1. - int last_hidden_index_; + mutable int last_hidden_index_; // The timestamp of the event which closed the last menu - or 0. base::TimeDelta closing_event_time_; |