Index: chrome/browser/cocoa/reload_button.mm |
diff --git a/chrome/browser/cocoa/reload_button.mm b/chrome/browser/cocoa/reload_button.mm |
index 53e6c58239638eba4928223cb6795ee039e5a6f4..e5a335729d8e48e920b007e477000f9b80bd9931 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/view_id_util.h" |
namespace { |
@@ -50,6 +51,7 @@ NSString* const kStopImageName = @"stop_Template.pdf"; |
// Don't allow multi-clicks, because the user probably wouldn't ever |
// want to stop+reload or reload+stop. |
[self setIgnoresMultiClick:YES]; |
+ [self setCommand:IDC_RELOAD]; |
} |
- (void)setIsLoading:(BOOL)isLoading force:(BOOL)force { |
@@ -60,17 +62,17 @@ NSString* const kStopImageName = @"stop_Template.pdf"; |
// that reload mode is desired and make no change. |
if (isLoading) { |
[self setImage:nsimage_cache::ImageNamed(kStopImageName)]; |
- [self setTag:IDC_STOP]; |
+ [self setCommand:IDC_STOP]; |
} else if (force || ![self isMouseInside]) { |
[self setImage:nsimage_cache::ImageNamed(kReloadImageName)]; |
- [self setTag:IDC_RELOAD]; |
- } else if ([self tag] == IDC_STOP) { |
+ [self setCommand:IDC_RELOAD]; |
+ } else if ([self command] == IDC_STOP) { |
pendingReloadMode_ = YES; |
} |
} |
- (BOOL)sendAction:(SEL)theAction to:(id)theTarget { |
- if ([self tag] == IDC_STOP) { |
+ if ([self command] == IDC_STOP) { |
// The stop command won't be valid after the attempt to change |
// back to reload. But it "worked", so short-circuit it. |
const BOOL ret = |
@@ -105,6 +107,11 @@ NSString* const kStopImageName = @"stop_Template.pdf"; |
return trackingArea_ && isMouseInside_; |
} |
+// Tag is used solely for ViewID. Override to prevent changing of it. |
+- (NSInteger)tag { |
+ return view_id_util::ViewIDToTag(VIEW_ID_RELOAD_BUTTON); |
+} |
+ |
@end // ReloadButton |
@implementation ReloadButton (Testing) |