| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |