Index: ui/base/cocoa/controls/hover_image_menu_button_cell.h |
diff --git a/ui/base/cocoa/controls/hover_image_menu_button_cell.h b/ui/base/cocoa/controls/hover_image_menu_button_cell.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..32fd789e4e8be457ac7cf51371c25bf372292a72 |
--- /dev/null |
+++ b/ui/base/cocoa/controls/hover_image_menu_button_cell.h |
@@ -0,0 +1,32 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_BASE_COCOA_CONTROLS_HOVER_IMAGE_MENU_BUTTON_CELL_H_ |
+#define UI_BASE_COCOA_CONTROLS_HOVER_IMAGE_MENU_BUTTON_CELL_H_ |
+ |
+#import <Cocoa/Cocoa.h> |
+ |
+#include "base/memory/scoped_nsobject.h" |
+ |
+// A custom NSPopUpButtonCell that permits a hover image, and draws only an |
+// image in its frame; no border, bezel or drop-down arrow. Use setImage to set |
+// the default image, setAlternateImage to set the button shown while the menu |
+// is active, and setHoverImage for the mouseover hover image. |
+@interface HoverImageMenuButtonCell : NSPopUpButtonCell { |
+ @private |
+ scoped_nsobject<NSImage> hoverImage_; |
+ BOOL hovered_; |
+} |
+ |
+@property(assign, nonatomic, getter=isHovered) BOOL hovered; |
+ |
+- (void)setHoverImage:(NSImage*)newImage; |
sail
2013/05/31 19:07:03
use @property to declare this?
tapted
2013/06/03 12:49:18
Done.
|
+- (NSImage*)hoverImage; |
+ |
+// Return the image that would be drawn based on the current state flags. |
+- (NSImage*)imageToDraw; |
+ |
+@end |
+ |
+#endif // UI_BASE_COCOA_CONTROLS_HOVER_IMAGE_MENU_BUTTON_CELL_H_ |