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
This commit is contained in:
stuart.morgan%alumni.case.edu
2008-09-25 04:57:28 +00:00
parent b7f3d19573
commit 98386ef954

View File

@@ -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;