if (firstResponder == static_cast<NSResponder*>(view))
return true;
+ // Handle special case for VIEW_ID_TAB_CONTAINER. The tab container NSView
+ // always transfers first responder status to its subview, so test whether
+ // |firstResponder| is a descendant.
+ if (vid == VIEW_ID_TAB_CONTAINER &&
+ [firstResponder isKindOfClass:[NSView class]])
+ return [static_cast<NSView*>(firstResponder) isDescendantOf:view];
+
// Handle the special case of focusing a TextField.
if ([firstResponder isKindOfClass:[NSTextView class]]) {
NSView* delegate = static_cast<NSView*>([(NSTextView*)firstResponder