| 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 "ios/chrome/browser/passwords/password_generation_prompt_view.h" | 5 #import "ios/chrome/browser/passwords/password_generation_prompt_view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "components/strings/grit/components_strings.h" | 10 #include "components/strings/grit/components_strings.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 NSMutableAttributedString* string = [[NSMutableAttributedString alloc] | 194 NSMutableAttributedString* string = [[NSMutableAttributedString alloc] |
| 195 initWithString:l10n_util::GetNSString( | 195 initWithString:l10n_util::GetNSString( |
| 196 IDS_IOS_GENERATED_PASSWORD_PROMPT_TITLE) | 196 IDS_IOS_GENERATED_PASSWORD_PROMPT_TITLE) |
| 197 attributes:attrsDictionary]; | 197 attributes:attrsDictionary]; |
| 198 | 198 |
| 199 UILabel* titleLabel = [[UILabel alloc] init]; | 199 UILabel* titleLabel = [[UILabel alloc] init]; |
| 200 [titleLabel setAttributedText:string]; | 200 [titleLabel setAttributedText:string]; |
| 201 [titleLabel setNumberOfLines:0]; | 201 [titleLabel setNumberOfLines:0]; |
| 202 [titleLabel sizeToFit]; | 202 [titleLabel sizeToFit]; |
| 203 return titleLabel = nil; | 203 return titleLabel; |
| 204 } | 204 } |
| 205 | 205 |
| 206 - (UILabel*)passwordLabel:(NSString*)password { | 206 - (UILabel*)passwordLabel:(NSString*)password { |
| 207 UILabel* passwordLabel = [[UILabel alloc] init]; | 207 UILabel* passwordLabel = [[UILabel alloc] init]; |
| 208 [passwordLabel setText:password]; | 208 [passwordLabel setText:password]; |
| 209 [passwordLabel setTextColor:UIColorFromRGB(kPasswordLabelFontColor)]; | 209 [passwordLabel setTextColor:UIColorFromRGB(kPasswordLabelFontColor)]; |
| 210 [passwordLabel setFont:[[MDCTypography fontLoader] | 210 [passwordLabel setFont:[[MDCTypography fontLoader] |
| 211 regularFontOfSize:kPasswordLabelFontSize]]; | 211 regularFontOfSize:kPasswordLabelFontSize]]; |
| 212 [passwordLabel setNumberOfLines:1]; | 212 [passwordLabel setNumberOfLines:1]; |
| 213 [passwordLabel sizeToFit]; | 213 [passwordLabel sizeToFit]; |
| 214 return passwordLabel = nil; | 214 return passwordLabel; |
| 215 } | 215 } |
| 216 | 216 |
| 217 - (UITextView*)description { | 217 - (UITextView*)description { |
| 218 NSRange linkRange; | 218 NSRange linkRange; |
| 219 NSString* description = ParseStringWithLink( | 219 NSString* description = ParseStringWithLink( |
| 220 l10n_util::GetNSString(IDS_IOS_GENERATED_PASSWORD_PROMPT_DESCRIPTION), | 220 l10n_util::GetNSString(IDS_IOS_GENERATED_PASSWORD_PROMPT_DESCRIPTION), |
| 221 &linkRange); | 221 &linkRange); |
| 222 | 222 |
| 223 NSMutableParagraphStyle* paragraphStyle = | 223 NSMutableParagraphStyle* paragraphStyle = |
| 224 [[NSMutableParagraphStyle alloc] init]; | 224 [[NSMutableParagraphStyle alloc] init]; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 metrics:metrics | 386 metrics:metrics |
| 387 views:views]]; | 387 views:views]]; |
| 388 [self addConstraints:[NSLayoutConstraint | 388 [self addConstraints:[NSLayoutConstraint |
| 389 constraintsWithVisualFormat:@"H:|[view]|" | 389 constraintsWithVisualFormat:@"H:|[view]|" |
| 390 options:0 | 390 options:0 |
| 391 metrics:nil | 391 metrics:nil |
| 392 views:views]]; | 392 views:views]]; |
| 393 } | 393 } |
| 394 | 394 |
| 395 @end | 395 @end |
| OLD | NEW |