| Index: chrome/browser/tab_contents/tab_contents_view_mac.mm
|
| ===================================================================
|
| --- chrome/browser/tab_contents/tab_contents_view_mac.mm (revision 64127)
|
| +++ chrome/browser/tab_contents/tab_contents_view_mac.mm (working copy)
|
| @@ -56,6 +56,7 @@
|
| offset:(NSPoint)offset;
|
| - (void)cancelDeferredClose;
|
| - (void)closeTabAfterEvent;
|
| +- (void)viewDidBecomeFirstResponder:(NSNotification*)notification;
|
| @end
|
|
|
| // static
|
| @@ -346,6 +347,12 @@
|
| // by TabContentsController, so we can't just override -viewID method to
|
| // return it.
|
| view_id_util::SetID(self, VIEW_ID_TAB_CONTAINER);
|
| +
|
| + [[NSNotificationCenter defaultCenter]
|
| + addObserver:self
|
| + selector:@selector(viewDidBecomeFirstResponder:)
|
| + name:kViewDidBecomeFirstResponder
|
| + object:nil];
|
| }
|
| return self;
|
| }
|
| @@ -358,6 +365,9 @@
|
|
|
| // This probably isn't strictly necessary, but can't hurt.
|
| [self unregisterDraggedTypes];
|
| +
|
| + [[NSNotificationCenter defaultCenter] removeObserver:self];
|
| +
|
| [super dealloc];
|
| }
|
|
|
| @@ -482,4 +492,19 @@
|
| tabContentsView_->CloseTab();
|
| }
|
|
|
| +- (void)viewDidBecomeFirstResponder:(NSNotification*)notification {
|
| + NSView* view = [notification object];
|
| + if (![[self subviews] containsObject:view])
|
| + return;
|
| +
|
| + NSSelectionDirection direction =
|
| + [[[notification userInfo] objectForKey:kSelectionDirection]
|
| + unsignedIntegerValue];
|
| + if (direction == NSDirectSelection)
|
| + return;
|
| +
|
| + [self tabContents]->
|
| + FocusThroughTabTraversal(direction == NSSelectingPrevious);
|
| +}
|
| +
|
| @end
|
|
|