| 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 #ifndef CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ | 5 #ifndef CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ |
| 6 #define CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ | 6 #define CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/scoped_nsobject.h" |
| 11 |
| 10 // Base class for button cells for toolbar and bookmark bar. | 12 // Base class for button cells for toolbar and bookmark bar. |
| 11 // | 13 // |
| 12 // This is a button cell that handles drawing/highlighting of buttons. | 14 // This is a button cell that handles drawing/highlighting of buttons. |
| 13 // The appearance is determined by setting the cell's tag (not the | 15 // The appearance is determined by setting the cell's tag (not the |
| 14 // view's) to one of the constants below (ButtonType). | 16 // view's) to one of the constants below (ButtonType). |
| 15 | 17 |
| 16 enum { | 18 enum { |
| 17 kLeftButtonType = -1, | 19 kLeftButtonType = -1, |
| 18 kLeftButtonWithShadowType = -2, | 20 kLeftButtonWithShadowType = -2, |
| 19 kStandardButtonType = 0, | 21 kStandardButtonType = 0, |
| 20 kRightButtonType = 1, | 22 kRightButtonType = 1, |
| 21 }; | 23 }; |
| 22 typedef NSInteger ButtonType; | 24 typedef NSInteger ButtonType; |
| 23 | 25 |
| 24 @interface GradientButtonCell : NSButtonCell { | 26 @interface GradientButtonCell : NSButtonCell { |
| 27 @private |
| 28 // Custom drawing means we need to perform our own mouse tracking if |
| 29 // the cell is setShowsBorderOnlyWhileMouseInside:YES. |
| 30 BOOL isMouseInside_; |
| 31 scoped_nsobject<NSTrackingArea> trackingArea_; |
| 32 BOOL shouldTheme_; |
| 25 } | 33 } |
| 34 // Turn off theming. Temporary work-around. |
| 35 - (void)setShouldTheme:(BOOL)shouldTheme; |
| 36 @end |
| 37 |
| 38 @interface GradientButtonCell(TestingAPI) |
| 39 - (BOOL)isMouseInside; |
| 26 @end | 40 @end |
| 27 | 41 |
| 28 #endif // CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ | 42 #endif // CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ |
| OLD | NEW |