summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-26 13:36:08 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-26 13:36:08 +0000
commitf946edc1d03dda4c4fed3ff05b8c317f1b18fa7a (patch)
treef8e0583d098b5f87e89c594088e061f30163009e /chrome
parent1cc4ba49a5cd42d9498524ecbe1f8e92fc735ed1 (diff)
downloadchromium_src-f946edc1d03dda4c4fed3ff05b8c317f1b18fa7a.zip
chromium_src-f946edc1d03dda4c4fed3ff05b8c317f1b18fa7a.tar.gz
chromium_src-f946edc1d03dda4c4fed3ff05b8c317f1b18fa7a.tar.bz2
Don't use rapid-close mode when middle-clicking a pinned tab to close it as the calculations get all messed up due to the differences in widths.
BUG=51298 TEST=closing tabs and middle-click closing tabs, making sure everything resizes as expected. Review URL: http://codereview.chromium.org/3116037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index fbe48bf..2bc8730 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -619,10 +619,17 @@ private:
if (!isClosingLastTab) {
// Limit the width available for laying out tabs so that tabs are not
// resized until a later time (when the mouse leaves the tab strip).
+ // However, if the tab being closed is a pinned tab, break out of
+ // rapid-closure mode since the mouse is almost guaranteed not to be over
+ // the closebox of the adjacent tab (due to the difference in widths).
// TODO(pinkerton): re-visit when handling tab overflow.
// http://crbug.com/188
- NSView* penultimateTab = [self viewAtIndex:numberOfOpenTabs - 2];
- availableResizeWidth_ = NSMaxX([penultimateTab frame]);
+ if (tabStripModel_->IsTabPinned(index)) {
+ availableResizeWidth_ = kUseFullAvailableWidth;
+ } else {
+ NSView* penultimateTab = [self viewAtIndex:numberOfOpenTabs - 2];
+ availableResizeWidth_ = NSMaxX([penultimateTab frame]);
+ }
} else {
// If the rightmost tab is closed, change the available width so that
// another tab's close button lands below the cursor (assuming the tabs