Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: chrome/browser/ui/cocoa/image_button_cell.h

Issue 11647050: mac: attempt to fix a startup perf regression after r174653 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/image_button_cell.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_UI_COCOA_IMAGE_BUTTON_CELL_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_IMAGE_BUTTON_CELL_H_
6 #define CHROME_BROWSER_UI_COCOA_IMAGE_BUTTON_CELL_H_ 6 #define CHROME_BROWSER_UI_COCOA_IMAGE_BUTTON_CELL_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/memory/scoped_nsobject.h" 10 #include "base/memory/scoped_nsobject.h"
(...skipping 18 matching lines...) Expand all
29 @optional 29 @optional
30 // Sent from an ImageButtonCell to its view when the mouse enters or exits the 30 // Sent from an ImageButtonCell to its view when the mouse enters or exits the
31 // cell. 31 // cell.
32 - (void)mouseInsideStateDidChange:(BOOL)isInside; 32 - (void)mouseInsideStateDidChange:(BOOL)isInside;
33 @end 33 @end
34 34
35 // A button cell that can disable a different image for each possible button 35 // A button cell that can disable a different image for each possible button
36 // state. Images are specified by image IDs. 36 // state. Images are specified by image IDs.
37 @interface ImageButtonCell : NSButtonCell { 37 @interface ImageButtonCell : NSButtonCell {
38 @private 38 @private
39 scoped_nsobject<NSImage> image_[image_button_cell::kButtonStateCount]; 39 struct {
40 // At most one of these two fields will be non-null.
41 int imageId;
42 scoped_nsobject<NSImage> image;
43 } image_[image_button_cell::kButtonStateCount];
40 NSInteger overlayImageID_; 44 NSInteger overlayImageID_;
41 BOOL isMouseInside_; 45 BOOL isMouseInside_;
42 } 46 }
43 47
44 @property(assign, nonatomic) NSInteger overlayImageID; 48 @property(assign, nonatomic) NSInteger overlayImageID;
45 @property(assign, nonatomic) BOOL isMouseInside; 49 @property(assign, nonatomic) BOOL isMouseInside;
46 50
47 // Sets the image for the given button state using an image ID. 51 // Sets the image for the given button state using an image ID.
48 // The image will be loaded from a resource pak. 52 // The image will be lazy loaded from a resource pak -- important because
53 // this is in the hot path for startup.
49 - (void)setImageID:(NSInteger)imageID 54 - (void)setImageID:(NSInteger)imageID
50 forButtonState:(image_button_cell::ButtonState)state; 55 forButtonState:(image_button_cell::ButtonState)state;
51 56
52 // Sets the image for the given button state using an image. 57 // Sets the image for the given button state using an image.
53 - (void)setImage:(NSImage*)image 58 - (void)setImage:(NSImage*)image
54 forButtonState:(image_button_cell::ButtonState)state; 59 forButtonState:(image_button_cell::ButtonState)state;
55 60
56 @end 61 @end
57 62
58 #endif // CHROME_BROWSER_UI_COCOA_IMAGE_BUTTON_CELL_H_ 63 #endif // CHROME_BROWSER_UI_COCOA_IMAGE_BUTTON_CELL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/image_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698