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

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

Issue 7466016: Fix up reload button to not flicker, and simplify implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix up comments Created 9 years, 4 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
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 #pragma once 7 #pragma once
8 8
9 #import <Cocoa/Cocoa.h> 9 #import <Cocoa/Cocoa.h>
10 10
11 namespace image_button_cell { 11 namespace image_button_cell {
12 12
13 // Possible states 13 // Possible states
14 enum ButtonState { 14 enum ButtonState {
15 kDefaultState = 0, 15 kDefaultState = 0,
16 kHoverState, 16 kHoverState,
17 kPressedState, 17 kPressedState,
18 kDisabledState, 18 kDisabledState,
19 kButtonStateCount 19 kButtonStateCount
20 }; 20 };
21 21
22 } // namespace ImageButtonCell 22 } // namespace ImageButtonCell
23 23
24 @protocol ImageButton
25 @optional
26 // Sent from an ImageButtonCell to it's view when the mouse enters or exits the
27 // cell.
28 - (void)mouseInsideStateDidChange:(BOOL)isInside;
29 @end
30
24 // A button cell that can disable a different image for each possible button 31 // A button cell that can disable a different image for each possible button
25 // state. Images are specified by image IDs. 32 // state. Images are specified by image IDs.
26 @interface ImageButtonCell : NSButtonCell { 33 @interface ImageButtonCell : NSButtonCell {
27 @private 34 @private
28 NSInteger imageID_[image_button_cell::kButtonStateCount]; 35 NSInteger imageID_[image_button_cell::kButtonStateCount];
29 NSInteger overlayImageID_; 36 NSInteger overlayImageID_;
30 BOOL isMouseInside_; 37 BOOL isMouseInside_;
31 } 38 }
32 39
33 @property(assign, nonatomic) BOOL isMouseInside; 40 @property(assign, nonatomic) BOOL isMouseInside;
34 @property(assign, nonatomic) NSInteger overlayImageID; 41 @property(assign, nonatomic) NSInteger overlayImageID;
35 42
36 // Sets the image for the given button state using an image ID. 43 // Sets the image for the given button state using an image ID.
37 // The image will be lazy loaded from a resource pak. 44 // The image will be lazy loaded from a resource pak.
38 - (void)setImageID:(NSInteger)imageID 45 - (void)setImageID:(NSInteger)imageID
39 forButtonState:(image_button_cell::ButtonState)state; 46 forButtonState:(image_button_cell::ButtonState)state;
40 47
41 @end 48 @end
42 49
43 #endif // CHROME_BROWSER_UI_COCOA_IMAGE_BUTTON_CELL_H_ 50 #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') | chrome/browser/ui/cocoa/toolbar/reload_button.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698