summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-10 20:49:44 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-10 20:49:44 +0000
commit438ac7c9ac1654e0dc3fc957cc073548a16ccfac (patch)
tree7b6b88797bf06878f25b1077293e480023607c7e /chrome/browser/cocoa
parentdfd0c37f0ec380ee391cfec4494232ce7029d23d (diff)
downloadchromium_src-438ac7c9ac1654e0dc3fc957cc073548a16ccfac.zip
chromium_src-438ac7c9ac1654e0dc3fc957cc073548a16ccfac.tar.gz
chromium_src-438ac7c9ac1654e0dc3fc957cc073548a16ccfac.tar.bz2
Update comments to clarify purpose of a function.
BUG=None TEST=None Review URL: http://codereview.chromium.org/2022005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_folder_controller.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
index 7b2ca0e..bc9a75a 100644
--- a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
@@ -402,6 +402,12 @@ const CGFloat kScrollWindowVerticalMargin = 0.0;
// TODO(mrossetti): See if the following can be moved into view's viewWillDraw:.
- (CGFloat)adjustButtonWidths {
CGFloat width = bookmarks::kBookmarkMenuButtonMinimumWidth;
+ // Use the cell's size as the base for determining the desired width of the
+ // button rather than the button's current width. -[cell cellSize] always
+ // returns the 'optimum' size of the cell based on the cell's contents even
+ // if it's less than the current button size. Relying on the button size
+ // would result in buttons that could only get wider but we want to handle
+ // the case where the widest button gets removed from a folder menu.
for (BookmarkButton* button in buttons_.get())
width = std::max(width, [[button cell] cellSize].width);
width = std::min(width, bookmarks::kBookmarkMenuButtonMaximumWidth);