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

Unified Diff: ios/clean/chrome/browser/ui/dialogs/dialog_text_field_configuration.mm

Issue 2929563002: [iOS Clean] Added dialogs UI support.
Patch Set: rebase & Mark's comments Created 3 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 side-by-side diff with in-line comments
Download patch
Index: ios/clean/chrome/browser/ui/dialogs/dialog_text_field_configuration.mm
diff --git a/ios/clean/chrome/browser/ui/dialogs/dialog_text_field_configuration.mm b/ios/clean/chrome/browser/ui/dialogs/dialog_text_field_configuration.mm
new file mode 100644
index 0000000000000000000000000000000000000000..2bb43d3146f64c424004c4233829df3d0e9b617e
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/dialogs/dialog_text_field_configuration.mm
@@ -0,0 +1,56 @@
+// 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_configuration.h"
+
+#include "base/logging.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@interface DialogTextFieldConfiguration ()
+
+// Initializer used by the factory method.
+- (instancetype)initWithDefaultText:(NSString*)defaultText
+ placeholderText:(NSString*)placeholderText
+ secure:(BOOL)secure
+ idenfifier:(id)identifier NS_DESIGNATED_INITIALIZER;
+
+@end
+
+@implementation DialogTextFieldConfiguration
+
+@synthesize defaultText = _defaultText;
+@synthesize placeholderText = _placeholderText;
+@synthesize secure = _secure;
+@synthesize identifier = _identifier;
+
+- (instancetype)initWithDefaultText:(NSString*)defaultText
+ placeholderText:(NSString*)placeholderText
+ secure:(BOOL)secure
+ idenfifier:(id)identifier {
+ DCHECK(identifier);
+ if ((self = [super init])) {
+ _defaultText = [defaultText copy];
+ _placeholderText = [placeholderText copy];
+ _secure = secure;
+ _identifier = identifier;
+ }
+ return self;
+}
+
+#pragma mark - Public
+
++ (instancetype)itemWithDefaultText:(NSString*)defaultText
+ placeholderText:(NSString*)placeholderText
+ secure:(BOOL)secure
+ identifier:(id)identifier {
+ return [[[self class] alloc] initWithDefaultText:defaultText
+ placeholderText:placeholderText
+ secure:secure
+ idenfifier:identifier];
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698