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..e938748c5201291684a33616a495dcbb66938776 100644 |
--- a/chrome/browser/ui/cocoa/image_button_cell.h |
+++ b/chrome/browser/ui/cocoa/image_button_cell.h |
@@ -23,6 +23,11 @@ enum ButtonState { |
kButtonStateCount |
}; |
+enum ImageType { |
sail
2013/01/04 05:27:24
It doesn't seem like you actually need this.
imag
Nico
2013/01/04 05:52:55
Thanks, this makes things slightly better. Done.
|
+ kImageId, |
+ kImage, |
+}; |
+ |
} // namespace ImageButtonCell |
@protocol ImageButton |
@@ -36,7 +41,11 @@ enum ButtonState { |
// state. Images are specified by image IDs. |
@interface ImageButtonCell : NSButtonCell { |
@private |
- scoped_nsobject<NSImage> image_[image_button_cell::kButtonStateCount]; |
+ struct { |
+ image_button_cell::ImageType type; |
+ int imageId; |
+ scoped_nsobject<NSImage> image; |
+ } image_[image_button_cell::kButtonStateCount]; |
NSInteger overlayImageID_; |
BOOL isMouseInside_; |
} |
@@ -45,7 +54,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; |