Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 985193003: Change profile name textfield behaviour on tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698