summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/hover_close_button.h
diff options
context:
space:
mode:
authorfeldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-07 01:31:08 +0000
committerfeldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-07 01:31:08 +0000
commit60a50255ede2001cef2c52bee8377ede6fcd1473 (patch)
treef0254591e595b8742ac39199162ca3b513fa1f15 /chrome/browser/cocoa/hover_close_button.h
parentba89742ced6463b6d555b8caf3806ad45d48e39b (diff)
downloadchromium_src-60a50255ede2001cef2c52bee8377ede6fcd1473.zip
chromium_src-60a50255ede2001cef2c52bee8377ede6fcd1473.tar.gz
chromium_src-60a50255ede2001cef2c52bee8377ede6fcd1473.tar.bz2
Fix stuck hover states on tab close buttons
Use the |bounds| property instead of the |frame| property when updating tracking rectangles and deciding whether the button has the mouse over it. We used to do this from the parent views context, but moved the code into the button itself and this broke. Check the image state when the mouseDown event loop finishes. We can get into a weird state when the tabs resize and the close button is placed under the cursor. We update the image to highlight it, but if we click/hold the mouse button without moving the mouse, there are no mouseMove events and thus no mouseEntered, and thus no mouseExited (just assuming that's what is happening). BUG=31279 TEST=Open a bunch of tabs, Click/hold on the last close button, then let go. Wit hout moving the mouse at all, click/hold on the next button that moves under the mouse. Drag mouse away from tab strip area and let go. It should unhighlight it self. Review URL: http://codereview.chromium.org/524016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35678 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/hover_close_button.h')
-rw-r--r--chrome/browser/cocoa/hover_close_button.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/hover_close_button.h b/chrome/browser/cocoa/hover_close_button.h
index ac42bf8..7c34395 100644
--- a/chrome/browser/cocoa/hover_close_button.h
+++ b/chrome/browser/cocoa/hover_close_button.h
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#import <Cocoa/Cocoa.h>
+
#include "base/scoped_nsobject.h"
// The standard close button for our Mac UI which is the "x"
@@ -20,4 +21,11 @@
// Sets up the button's images, tracking areas, and accessibility info
// when instantiated via initWithFrame or awakeFromNib.
- (void)commonInit;
+
+// Checks to see whether the mouse is in the button's bounds and update
+// the image in case it gets out of sync. This occurs when you close a
+// tab so the tab to the left of it takes its place, and drag the button
+// without moving the mouse before you press the button down.
+- (void)checkImageState;
+
@end