Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
index bd7a5421e3a35ecabf948050f9a5c698202e55ac..549b13b8542aeebef8661612803cec4fc10f2462 100644 |
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
@@ -736,11 +736,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
[controller_ |
postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_NAME]; |
[profileNameTextField_ setHidden:YES]; |
- // This needs to be called async as the firstResponder is reset |
- // at the same time that controlTextDidEndEditing happens. |
- dispatch_async(dispatch_get_main_queue(), ^{ |
- [[self window] makeFirstResponder:nil]; |
- }); |
} |
} |
@@ -753,8 +748,15 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
return false; |
} |
-- (void)controlTextDidEndEditing:(NSNotification*)notification { |
- [self saveProfileName]; |
+- (BOOL)control:(NSControl*)control |
groby-ooo-7-16
2015/03/10 23:58:56
What if I _click_ outside of the text field?
|
+ textView:(NSTextView*)textView |
+ doCommandBySelector:(SEL)commandSelector { |
+ if (commandSelector == @selector(insertTab:) || |
+ commandSelector == @selector(insertNewline:)) { |
+ [self saveProfileName]; |
+ return YES; |
+ } |
+ return NO; |
} |
@end |