summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/image_button_cell.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/cocoa/image_button_cell.h')
-rw-r--r--chrome/browser/ui/cocoa/image_button_cell.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/ui/cocoa/image_button_cell.h b/chrome/browser/ui/cocoa/image_button_cell.h
index 8d64c1e..74feb94 100644
--- a/chrome/browser/ui/cocoa/image_button_cell.h
+++ b/chrome/browser/ui/cocoa/image_button_cell.h
@@ -36,7 +36,11 @@ enum ButtonState {
// state. Images are specified by image IDs.
@interface ImageButtonCell : NSButtonCell {
@private
- scoped_nsobject<NSImage> image_[image_button_cell::kButtonStateCount];
+ struct {
+ // At most one of these two fields will be non-null.
+ int imageId;
+ scoped_nsobject<NSImage> image;
+ } image_[image_button_cell::kButtonStateCount];
NSInteger overlayImageID_;
BOOL isMouseInside_;
}
@@ -45,7 +49,8 @@ enum ButtonState {
@property(assign, nonatomic) BOOL isMouseInside;
// Sets the image for the given button state using an image ID.
-// The image will be loaded from a resource pak.
+// The image will be lazy loaded from a resource pak -- important because
+// this is in the hot path for startup.
- (void)setImageID:(NSInteger)imageID
forButtonState:(image_button_cell::ButtonState)state;