Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/dialogs/dialog_text_field_item.mm |
| diff --git a/ios/clean/chrome/browser/ui/dialogs/dialog_text_field_item.mm b/ios/clean/chrome/browser/ui/dialogs/dialog_text_field_item.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6467716d7975a28e304d12da6682ad77c0a1dbc6 |
| --- /dev/null |
| +++ b/ios/clean/chrome/browser/ui/dialogs/dialog_text_field_item.mm |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#import "ios/clean/chrome/browser/ui/dialogs/dialog_text_field_item.h" |
| + |
| +#if !defined(__has_feature) || !__has_feature(objc_arc) |
| +#error "This file requires ARC support." |
| +#endif |
| + |
| +@interface DialogTextFieldItem () |
| + |
| +// Initializer used by the factory method. |
| +- (instancetype)initWithDefaultText:(NSString*)defaultText |
| + placeholderText:(NSString*)placeholderText |
| + secure:(BOOL)secure NS_DESIGNATED_INITIALIZER; |
| + |
| +@end |
| + |
| +@implementation DialogTextFieldItem |
| + |
| +@synthesize defaultText = _defaultText; |
| +@synthesize placeholderText = _placeholderText; |
| +@synthesize secure = _secure; |
| + |
| +- (instancetype)initWithDefaultText:(NSString*)defaultText |
| + placeholderText:(NSString*)placeholderText |
| + secure:(BOOL)secure { |
| + if ((self = [super init])) { |
| + _defaultText = defaultText; |
|
marq (ping after 24h)
2017/06/14 10:52:15
copy strings.
kkhorimoto
2017/06/23 06:24:18
Done.
|
| + _placeholderText = placeholderText; |
| + _secure = secure; |
| + } |
| + return self; |
| +} |
| + |
| +#pragma mark - Public |
| + |
| ++ (instancetype)itemWithDefaultText:(NSString*)defaultText |
| + placeholderText:(NSString*)placeholderText |
| + secure:(BOOL)secure { |
| + return [[[self class] alloc] initWithDefaultText:defaultText |
| + placeholderText:placeholderText |
| + secure:secure]; |
| +} |
| + |
| +@end |