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

Unified Diff: chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm

Issue 1969383002: Change the maximum account chooser height to 3.5 rows on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/passwords/account_chooser_view_controller.mm
diff --git a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm
index 9a15399faf0a709e9bd1ae7ec11932c197248715..949b5139ccaa955bc8df680172f8cfb6f27a3cf8 100644
--- a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm
+++ b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm
@@ -31,8 +31,8 @@ namespace {
constexpr CGFloat kCredentialHeight =
kAvatarImageSize + 2 * kVerticalAvatarMargin;
-// Maximum number of accounts displayed before vertical scrolling appears.
-constexpr size_t kMaxAccounts = 3;
+// Maximum height of the credential list. The unit is one row height.
+constexpr CGFloat kMaxHeightAccounts = 3.5;
} // namespace
@@ -104,12 +104,14 @@ constexpr size_t kMaxAccounts = 3;
NSSize buttonsSize = NSMakeSize(
kDesiredBubbleWidth,
- std::min([credentialButtons_ count], kMaxAccounts) * kCredentialHeight);
+ std::min<CGFloat>([credentialButtons_ count], kMaxHeightAccounts) *
+ kCredentialHeight);
base::scoped_nsobject<NSScrollView> scrollView = [[NSScrollView alloc]
initWithFrame:NSMakeRect(0, 0, buttonsSize.width, buttonsSize.height)];
- [scrollView setHasVerticalScroller:[credentialButtons_ count] > kMaxAccounts
- ? YES
- : NO];
+ [scrollView
+ setHasVerticalScroller:[credentialButtons_ count] > kMaxHeightAccounts
+ ? YES
+ : NO];
[scrollView setBorderType:NSNoBorder];
CGFloat buttonWidth = [scrollView contentSize].width;
CGFloat curY = 0;
« 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