From 3345a6884c488ff3a535c2c9acdd33d74b37e311 Mon Sep 17 00:00:00 2001 From: Iain Merrick Date: Tue, 19 Oct 2010 14:37:37 +0100 Subject: Merge Chromium at 7.0.540.0 : Initial merge by git Not including third_party/icu as it contains huge data files that break Gerrit, and aren't actually used. Change-Id: I428a386e70f3b58cacd28677b8cfda282e891e15 --- chrome/browser/cocoa/reload_button.mm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'chrome/browser/cocoa/reload_button.mm') diff --git a/chrome/browser/cocoa/reload_button.mm b/chrome/browser/cocoa/reload_button.mm index 4f82bf0..4a46a51 100644 --- a/chrome/browser/cocoa/reload_button.mm +++ b/chrome/browser/cocoa/reload_button.mm @@ -6,6 +6,7 @@ #include "base/nsimage_cache_mac.h" #include "chrome/app/chrome_dll_resource.h" +#import "chrome/browser/cocoa/gradient_button_cell.h" #import "chrome/browser/cocoa/view_id_util.h" namespace { @@ -58,15 +59,26 @@ NSString* const kStopImageName = @"stop_Template.pdf"; // Can always transition to stop mode. Only transition to reload // mode if forced or if the mouse isn't hovering. Otherwise, note - // that reload mode is desired and make no change. + // that reload mode is desired and disable the button. if (isLoading) { [self setImage:nsimage_cache::ImageNamed(kStopImageName)]; [self setTag:IDC_STOP]; + [self setEnabled:YES]; } else if (force || ![self isMouseInside]) { [self setImage:nsimage_cache::ImageNamed(kReloadImageName)]; [self setTag:IDC_RELOAD]; + + // This button's cell may not have received a mouseExited event, and + // therefore it could still think that the mouse is inside the button. Make + // sure the cell's sense of mouse-inside matches the local sense, to prevent + // drawing artifacts. + id cell = [self cell]; + if ([cell respondsToSelector:@selector(setMouseInside:animate:)]) + [cell setMouseInside:[self isMouseInside] animate:NO]; + [self setEnabled:YES]; } else if ([self tag] == IDC_STOP) { pendingReloadMode_ = YES; + [self setEnabled:NO]; } } -- cgit v1.1