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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 2682153002: macOS: Focus first profile (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
6 6
7 #import <Carbon/Carbon.h> // kVK_Return. 7 #import <Carbon/Carbon.h> // kVK_Return.
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 } else if (viewMode_ == profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) { 1587 } else if (viewMode_ == profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) {
1588 tutorialView = [self buildTutorialViewIfNeededForItem:item]; 1588 tutorialView = [self buildTutorialViewIfNeededForItem:item];
1589 } 1589 }
1590 currentProfileView = 1590 currentProfileView =
1591 switches::IsMaterialDesignUserMenu() 1591 switches::IsMaterialDesignUserMenu()
1592 ? [self createMaterialDesignCurrentProfileView:item] 1592 ? [self createMaterialDesignCurrentProfileView:item]
1593 : [self createCurrentProfileView:item]; 1593 : [self createCurrentProfileView:item];
1594 showLock = item.signed_in && 1594 showLock = item.signed_in &&
1595 profiles::IsLockAvailable(browser_->profile()); 1595 profiles::IsLockAvailable(browser_->profile());
1596 } else { 1596 } else {
1597 NSButton* otherProfileView = [self createOtherProfileView:i]; 1597 [otherProfiles addObject:[self createOtherProfileView:i]];
1598 if (!firstProfileView_) {
1599 firstProfileView_ = otherProfileView;
1600 }
1601 [otherProfiles addObject:otherProfileView];
1602 } 1598 }
1603 } 1599 }
1600 firstProfileView_ = [otherProfiles lastObject];
1604 if (!currentProfileView) // Guest windows don't have an active profile. 1601 if (!currentProfileView) // Guest windows don't have an active profile.
1605 currentProfileView = [self createGuestProfileView]; 1602 currentProfileView = [self createGuestProfileView];
1606 1603
1607 // |yOffset| is the next position at which to draw in |container| 1604 // |yOffset| is the next position at which to draw in |container|
1608 // coordinates. Add a pixel offset so that the bottom option buttons don't 1605 // coordinates. Add a pixel offset so that the bottom option buttons don't
1609 // overlap the bubble's rounded corners. 1606 // overlap the bubble's rounded corners.
1610 CGFloat yOffset = 1; 1607 CGFloat yOffset = 1;
1611 1608
1612 if (isFastProfileChooser) { 1609 if (isFastProfileChooser) {
1613 if (!switches::IsMaterialDesignUserMenu()) { 1610 if (!switches::IsMaterialDesignUserMenu()) {
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 2960
2964 - (void)showWindow:(id)sender { 2961 - (void)showWindow:(id)sender {
2965 [super showWindow:sender]; 2962 [super showWindow:sender];
2966 NSEvent *event = [[NSApplication sharedApplication] currentEvent]; 2963 NSEvent *event = [[NSApplication sharedApplication] currentEvent];
2967 if (firstProfileView_ && [event type] == NSKeyDown) { 2964 if (firstProfileView_ && [event type] == NSKeyDown) {
2968 [[self window] makeFirstResponder:firstProfileView_]; 2965 [[self window] makeFirstResponder:firstProfileView_];
2969 } 2966 }
2970 } 2967 }
2971 2968
2972 @end 2969 @end
OLDNEW
« 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