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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm

Issue 2028823003: Mac: Make ScopedTypeRef require explicit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dependency Created 4 years, 6 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 | « chrome/browser/ui/cocoa/new_tab_button.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_view.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/passwords/account_chooser_view_controller.h" 5 #import "chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 [signInButton_ setFrameOrigin:NSMakePoint(curX, kFramePadding)]; 121 [signInButton_ setFrameOrigin:NSMakePoint(curX, kFramePadding)];
122 } 122 }
123 [cancelButton_ setFrameOrigin:NSMakePoint( 123 [cancelButton_ setFrameOrigin:NSMakePoint(
124 curX - NSWidth([cancelButton_ frame]), 124 curX - NSWidth([cancelButton_ frame]),
125 kFramePadding)]; 125 kFramePadding)];
126 126
127 NSSize buttonsSize = NSMakeSize( 127 NSSize buttonsSize = NSMakeSize(
128 kDesiredBubbleWidth, 128 kDesiredBubbleWidth,
129 std::min<CGFloat>([credentialButtons_ count], kMaxHeightAccounts) * 129 std::min<CGFloat>([credentialButtons_ count], kMaxHeightAccounts) *
130 kCredentialHeight); 130 kCredentialHeight);
131 base::scoped_nsobject<NSScrollView> scrollView = [[NSScrollView alloc] 131 base::scoped_nsobject<NSScrollView> scrollView([[NSScrollView alloc]
132 initWithFrame:NSMakeRect(0, 0, buttonsSize.width, buttonsSize.height)]; 132 initWithFrame:NSMakeRect(0, 0, buttonsSize.width, buttonsSize.height)]);
133 [scrollView 133 [scrollView
134 setHasVerticalScroller:[credentialButtons_ count] > kMaxHeightAccounts 134 setHasVerticalScroller:[credentialButtons_ count] > kMaxHeightAccounts
135 ? YES 135 ? YES
136 : NO]; 136 : NO];
137 [scrollView setBorderType:NSNoBorder]; 137 [scrollView setBorderType:NSNoBorder];
138 CGFloat buttonWidth = [scrollView contentSize].width; 138 CGFloat buttonWidth = [scrollView contentSize].width;
139 CGFloat curY = 0; 139 CGFloat curY = 0;
140 base::scoped_nsobject<NSView> documentView([[NSView alloc] 140 base::scoped_nsobject<NSView> documentView([[NSView alloc]
141 initWithFrame:NSMakeRect(0, 0, buttonWidth, [credentialButtons_ count] * 141 initWithFrame:NSMakeRect(0, 0, buttonWidth, [credentialButtons_ count] *
142 kCredentialHeight)]); 142 kCredentialHeight)]);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 - (NSArray*)credentialButtons { 259 - (NSArray*)credentialButtons {
260 return credentialButtons_; 260 return credentialButtons_;
261 } 261 }
262 262
263 - (NSTextView*)titleView { 263 - (NSTextView*)titleView {
264 return titleView_; 264 return titleView_;
265 } 265 }
266 266
267 @end 267 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/new_tab_button.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698