diff options
author | Iain Merrick <husky@google.com> | 2010-10-19 14:37:37 +0100 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-10-19 14:37:37 +0100 |
commit | 3345a6884c488ff3a535c2c9acdd33d74b37e311 (patch) | |
tree | 7784b988ef1698cb6967ea1bdf07616237716c6c /chrome/browser/cocoa/reload_button.mm | |
parent | efc8475837ec58186051f23bb03542620424f6ce (diff) | |
download | external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.zip external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.gz external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/cocoa/reload_button.mm')
-rw-r--r-- | chrome/browser/cocoa/reload_button.mm | 14 |
1 files changed, 13 insertions, 1 deletions
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]; } } |