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

Unified Diff: chrome/browser/ui/cocoa/image_button_cell.mm

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, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/image_button_cell.mm
diff --git a/chrome/browser/ui/cocoa/image_button_cell.mm b/chrome/browser/ui/cocoa/image_button_cell.mm
index fe6dcb9f6504a0c61637f461ecffefc33ac21212..bb81227123cacb13f1fc97b15415dde73a82832f 100644
--- a/chrome/browser/ui/cocoa/image_button_cell.mm
+++ b/chrome/browser/ui/cocoa/image_button_cell.mm
@@ -138,10 +138,25 @@ const CGFloat kImageNoFocusAlpha = 0.65;
- (void)setIsMouseInside:(BOOL)isMouseInside {
if (isMouseInside_ != isMouseInside) {
isMouseInside_ = isMouseInside;
- [[self controlView] setNeedsDisplay:YES];
+ NSView<ImageButton>* control =
+ static_cast<NSView<ImageButton>*>([self controlView]);
+ if ([control respondsToSelector:@selector(mouseInsideStateDidChange:)]) {
+ [control mouseInsideStateDidChange:isMouseInside];
+ }
+ [control setNeedsDisplay:YES];
}
}
+- (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show {
+ VLOG_IF(1, !show) << "setShowsBorderOnlyWhileMouseInside:NO ignored";
+}
+
+- (BOOL)showsBorderOnlyWhileMouseInside {
+ // Always returns YES so that buttons always get mouse tracking even when
+ // disabled. The reload button (and possibly others) depend on this.
+ return YES;
+}
+
- (void)mouseEntered:(NSEvent*)theEvent {
[self setIsMouseInside:YES];
}

Powered by Google App Engine
This is Rietveld 408576698