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

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

Issue 2638853003: macOS: Setting focus to the first profile in profile switcher (Closed)
Patch Set: Removing useless import Created 3 years, 10 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 | « chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h ('k') | 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 caac7e85b636c9820ddf40ac024d3837bbee4bf5..25bd35d396fbd94dcfc8df9981c7fe8d4e584f9d 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
@@ -1594,7 +1594,11 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
showLock = item.signed_in &&
profiles::IsLockAvailable(browser_->profile());
} else {
- [otherProfiles addObject:[self createOtherProfileView:i]];
+ NSButton* otherProfileView = [self createOtherProfileView:i];
+ if (!firstProfileView_) {
+ firstProfileView_ = otherProfileView;
+ }
+ [otherProfiles addObject:otherProfileView];
}
}
if (!currentProfileView) // Guest windows don't have an active profile.
@@ -2945,4 +2949,12 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
return incognitoAvailable && !browser_->profile()->IsGuestSession();
}
+- (void)showWindow:(id)sender {
+ [super showWindow:sender];
+ NSEvent *event = [[NSApplication sharedApplication] currentEvent];
+ if (firstProfileView_ && [event type] == NSKeyDown) {
+ [[self window] makeFirstResponder:firstProfileView_];
+ }
+}
+
@end
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698