From 98386ef9540a4a800f6a7f6e58393463f319faab Mon Sep 17 00:00:00 2001 From: "stuart.morgan%alumni.case.edu" Date: Thu, 25 Sep 2008 04:57:28 +0000 Subject: [PATCH] Camino only - Bug 456176: Don't allow tabbing to tabs unless FKA is enabled. r=murph sr=pink git-svn-id: svn://10.0.0.236/trunk@254420 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/camino/src/browser/TabButtonView.mm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mozilla/camino/src/browser/TabButtonView.mm b/mozilla/camino/src/browser/TabButtonView.mm index 19a46e43d73..de648ecb07d 100644 --- a/mozilla/camino/src/browser/TabButtonView.mm +++ b/mozilla/camino/src/browser/TabButtonView.mm @@ -577,6 +577,25 @@ static NSImage* sTabButtonDividerImage = nil; #pragma mark - +- (BOOL)canBecomeKeyView +{ + // This a hack; NSView isn't smart about conditionally accepting first + // responder only when FKA is enabled, but NSButton apparently is, so + // piggy-back on our close button to get this information (there's no API; + // WebKit gets the information by manually reading the pref from the + // accessibility domain then watching for an undocumented notification). + // Perhaps we should look into making our tabs controls/buttons instead of + // views? + // + // mCloseButton will also return NO when it's disabled, so enable it before + // asking, then put it back. + BOOL closeButtonEnabled = [[self closeButton] isEnabled]; + [self setCloseButtonEnabled:YES]; + BOOL canBecomeKey = [mCloseButton canBecomeKeyView]; + [self setCloseButtonEnabled:closeButtonEnabled]; + return canBecomeKey; +} + - (BOOL)acceptsFirstResponder { return YES;