OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/scoped_nsobject.h" | 7 #include "base/scoped_nsobject.h" |
8 | 8 |
| 9 @class TabController; |
| 10 |
9 // The standard close button for our Mac UI which is the "x" | 11 // The standard close button for our Mac UI which is the "x" |
10 // that changes to the red circle with the "x" when you hover over it. | 12 // that changes to the red circle with the "x" when you hover over it. |
11 // At this time it is used by the popup blocker, download bar, info bar | 13 // At this time it is used by the popup blocker, download bar, info bar |
12 // and tabs. | 14 // and tabs. |
13 @interface HoverCloseButton : NSButton { | 15 @interface HoverCloseButton : NSButton { |
14 // Tracking area for close button mouseover images. | 16 // Tracking area for close button mouseover images. |
15 scoped_nsobject<NSTrackingArea> closeTrackingArea_; | 17 scoped_nsobject<NSTrackingArea> closeTrackingArea_; |
| 18 |
| 19 IBOutlet TabController* controller_; |
16 } | 20 } |
17 | 21 |
18 // Enables or disables the |NSTrackingRect|s for the button. | 22 // Enables or disables the |NSTrackingRect|s for the button. |
19 - (void)setTrackingEnabled:(BOOL)enabled; | 23 - (void)setTrackingEnabled:(BOOL)enabled; |
20 | 24 |
21 // Sets up the button's images, tracking areas, and accessibility info | 25 // Sets up the button's images, tracking areas, and accessibility info |
22 // when instantiated via initWithFrame or awakeFromNib. | 26 // when instantiated via initWithFrame or awakeFromNib. |
23 - (void)commonInit; | 27 - (void)commonInit; |
24 | 28 |
25 // Checks to see whether the mouse is in the button's bounds and update | 29 // Checks to see whether the mouse is in the button's bounds and update |
26 // the image in case it gets out of sync. This occurs when you close a | 30 // the image in case it gets out of sync. This occurs when you close a |
27 // tab so the tab to the left of it takes its place, and drag the button | 31 // tab so the tab to the left of it takes its place, and drag the button |
28 // without moving the mouse before you press the button down. | 32 // without moving the mouse before you press the button down. |
29 - (void)checkImageState; | 33 - (void)checkImageState; |
30 | 34 |
31 @end | 35 @end |
OLD | NEW |