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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm

Issue 650013007: Fix help text size calculation for password gen bubble on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: helpWidth -> contentWidth Created 6 years, 2 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/autofill/password_generation_popup_view_cocoa.h " 5 #import "chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.h "
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 CGFloat width = 157 CGFloat width =
158 autofill::kPopupBorderThickness + 158 autofill::kPopupBorderThickness +
159 controller_->kHorizontalPadding + 159 controller_->kHorizontalPadding +
160 [[keyIcon_ image] size].width + 160 [[keyIcon_ image] size].width +
161 controller_->kHorizontalPadding + 161 controller_->kHorizontalPadding +
162 std::max(passwordSize.width, passwordTitleSize.width) + 162 std::max(passwordSize.width, passwordTitleSize.width) +
163 controller_->kHorizontalPadding + 163 controller_->kHorizontalPadding +
164 autofill::kPopupBorderThickness; 164 autofill::kPopupBorderThickness;
165 165
166 width = std::max(width, (CGFloat)controller_->GetMinimumWidth()); 166 width = std::max(width, (CGFloat)controller_->GetMinimumWidth());
167 CGFloat contentWidth = width - (2 * controller_->kHorizontalPadding);
167 168
168 CGFloat height = 169 CGFloat height =
169 autofill::kPopupBorderThickness + 170 autofill::kPopupBorderThickness +
170 controller_->kHelpVerticalPadding + 171 controller_->kHelpVerticalPadding +
171 [self helpSizeForPopupWidth:width].height + 172 [self helpSizeForPopupWidth:contentWidth].height +
172 controller_->kHelpVerticalPadding + 173 controller_->kHelpVerticalPadding +
173 autofill::kPopupBorderThickness; 174 autofill::kPopupBorderThickness;
174 175
175 if (controller_->display_password()) 176 if (controller_->display_password())
176 height += controller_->kPopupPasswordSectionHeight; 177 height += controller_->kPopupPasswordSectionHeight;
177 178
178 return NSMakeSize(width, height); 179 return NSMakeSize(width, height);
179 } 180 }
180 181
181 - (void)updateBoundsAndRedrawPopup { 182 - (void)updateBoundsAndRedrawPopup {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 330
330 - (NSFont*)boldFont { 331 - (NSFont*)boldFont {
331 return [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]]; 332 return [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]];
332 } 333 }
333 334
334 - (NSFont*)textFont { 335 - (NSFont*)textFont {
335 return [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; 336 return [NSFont systemFontOfSize:[NSFont smallSystemFontSize]];
336 } 337 }
337 338
338 @end 339 @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