Index: chrome/browser/ui/cocoa/image_button_cell.h |
diff --git a/chrome/browser/ui/cocoa/image_button_cell.h b/chrome/browser/ui/cocoa/image_button_cell.h |
index 8d64c1e97f3d1f1cd93606ad1dea6d2bd9cd2ce0..74feb94c36e0fce1b58b3fd322dcf77de3926513 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; |