summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-01 23:54:12 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-01 23:54:12 +0000
commit0700c200bb205dde188c46096ca4c6bac3425b57 (patch)
tree8b69996c83f6c445956ce3c3612a92e6de4894d4 /chrome
parentbac0eb59f9ca057ff2b7eab7dab3664a37f0f2a5 (diff)
downloadchromium_src-0700c200bb205dde188c46096ca4c6bac3425b57.zip
chromium_src-0700c200bb205dde188c46096ca4c6bac3425b57.tar.gz
chromium_src-0700c200bb205dde188c46096ca4c6bac3425b57.tar.bz2
Don't close tabs on middle-click when the release happens off the tab. Patch by Mohamed Mansour, r=ben. See http://codereview.chromium.org/12816/ .
BUG=1062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6184 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/views/tabs/tab.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc
index d4b28ac..8a23f20 100644
--- a/chrome/browser/views/tabs/tab.cc
+++ b/chrome/browser/views/tabs/tab.cc
@@ -156,7 +156,11 @@ void Tab::OnMouseReleased(const views::MouseEvent& event, bool canceled) {
// Notify the drag helper that we're done with any potential drag operations.
// Clean up the drag helper, which is re-created on the next mouse press.
delegate_->EndDrag(canceled);
- if (event.IsMiddleMouseButton())
+
+ // Close tabs on middle click, but only if the button is released over the tab
+ // (normal windows behavior is to discard presses of a UI element where the
+ // releases happen off the element).
+ if (event.IsMiddleMouseButton() && HitTest(event.location()))
delegate_->CloseTab(this);
}