diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-21 19:13:58 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-21 19:13:58 +0000 |
commit | b119a1e6bdd11040f93245e0b71d654a4883b40a (patch) | |
tree | 60992bd5dfa4a5e2689eb02b8fdc6eed7d4d9231 | |
parent | 0bf46b99bb79d66c81587cb114b93516cb0af499 (diff) | |
download | chromium_src-b119a1e6bdd11040f93245e0b71d654a4883b40a.zip chromium_src-b119a1e6bdd11040f93245e0b71d654a4883b40a.tar.gz chromium_src-b119a1e6bdd11040f93245e0b71d654a4883b40a.tar.bz2 |
[Mac] Fix a problem with flicker when moving the mouse off the reload button.
BUG=46981
TEST=Click on the reload button and leave the mouse inside. When the page is finished reloading, move the mouse out of the button. The button should re-enable and change from stop to reload, but the border should not flicker.
Review URL: http://codereview.chromium.org/3467003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60085 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cocoa/reload_button.mm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/reload_button.mm b/chrome/browser/cocoa/reload_button.mm index 404b035..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 { @@ -66,6 +67,14 @@ NSString* const kStopImageName = @"stop_Template.pdf"; } 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; |