diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cocoa/find_bar_cocoa_controller.mm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/find_bar_cocoa_controller.mm b/chrome/browser/cocoa/find_bar_cocoa_controller.mm index d343577..58e687c 100644 --- a/chrome/browser/cocoa/find_bar_cocoa_controller.mm +++ b/chrome/browser/cocoa/find_bar_cocoa_controller.mm @@ -96,6 +96,25 @@ } } +// NSControl delegate method +- (BOOL)control:(NSControl*)control + textView:(NSTextView*)textView + doCommandBySelector:(SEL)command { + if (command == @selector(insertNewline:)) { + NSEvent* event = [NSApp currentEvent]; + + if ([event modifierFlags] & NSShiftKeyMask) + [previousButton_ performClick:nil]; + else { + [nextButton_ performClick:nil]; + } + + return YES; + } + + return NO; +} + // Methods from FindBar - (void)showFindBar { [[self view] setHidden:NO]; |