OLD | NEW |
---|---|
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 #import "chrome/browser/ui/cocoa/image_button_cell.h" | 5 #import "chrome/browser/ui/cocoa/image_button_cell.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "chrome/browser/themes/theme_service.h" | 8 #import "chrome/browser/themes/theme_service.h" |
9 #import "chrome/browser/ui/cocoa/image_utils.h" | 9 #import "chrome/browser/ui/cocoa/image_utils.h" |
10 #import "chrome/browser/ui/cocoa/themed_window.h" | 10 #import "chrome/browser/ui/cocoa/themed_window.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 ui::ThemeProvider* themeProvider = [[controlView window] themeProvider]; | 131 ui::ThemeProvider* themeProvider = [[controlView window] themeProvider]; |
132 if (!themeProvider) | 132 if (!themeProvider) |
133 return nil; | 133 return nil; |
134 | 134 |
135 return themeProvider->GetNSImageNamed(imageID, true); | 135 return themeProvider->GetNSImageNamed(imageID, true); |
136 } | 136 } |
137 | 137 |
138 - (void)setIsMouseInside:(BOOL)isMouseInside { | 138 - (void)setIsMouseInside:(BOOL)isMouseInside { |
139 if (isMouseInside_ != isMouseInside) { | 139 if (isMouseInside_ != isMouseInside) { |
140 isMouseInside_ = isMouseInside; | 140 isMouseInside_ = isMouseInside; |
141 [[self controlView] setNeedsDisplay:YES]; | 141 NSView<ImageButton>* control = (NSView<ImageButton>*)[self controlView]; |
Scott Hess - ex-Googler
2011/07/21 00:48:40
Is this supposed to be static_cast?
dmac
2011/07/29 20:01:00
Done.
| |
142 if ([control respondsToSelector:@selector(mouseInsideStateDidChange:)]) { | |
143 [control mouseInsideStateDidChange:isMouseInside]; | |
144 } | |
145 [control setNeedsDisplay:YES]; | |
142 } | 146 } |
143 } | 147 } |
144 | 148 |
145 - (void)mouseEntered:(NSEvent*)theEvent { | 149 - (void)mouseEntered:(NSEvent*)theEvent { |
146 [self setIsMouseInside:YES]; | 150 [self setIsMouseInside:YES]; |
147 } | 151 } |
148 | 152 |
149 - (void)mouseExited:(NSEvent*)theEvent { | 153 - (void)mouseExited:(NSEvent*)theEvent { |
150 [self setIsMouseInside:NO]; | 154 [self setIsMouseInside:NO]; |
151 } | 155 } |
152 | 156 |
153 @end | 157 @end |
OLD | NEW |