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

Unified Diff: ios/clean/chrome/browser/ui/dialogs/dialog_button_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_button_configuration.mm
diff --git a/ios/clean/chrome/browser/ui/dialogs/dialog_button_configuration.mm b/ios/clean/chrome/browser/ui/dialogs/dialog_button_configuration.mm
new file mode 100644
index 0000000000000000000000000000000000000000..5e5e39150edaccf9c1602b6bfea99dcddbba060a
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/dialogs/dialog_button_configuration.mm
@@ -0,0 +1,51 @@
+// 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_button_configuration.h"
+
+#include "base/logging.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@interface DialogButtonConfiguration ()
+
+// Initializer used by the factory method.
+- (instancetype)initWithText:(NSString*)text
+ style:(DialogButtonStyle)style
+ identifier:(id)identifier NS_DESIGNATED_INITIALIZER;
+
+@end
+
+@implementation DialogButtonConfiguration
+
+@synthesize text = _text;
+@synthesize style = _style;
+@synthesize identifier = _identifier;
+
+- (instancetype)initWithText:(NSString*)text
+ style:(DialogButtonStyle)style
+ identifier:(id)identifier {
+ DCHECK(text.length);
+ DCHECK(identifier);
+ if ((self = [super init])) {
+ _text = [text copy];
+ _style = style;
+ _identifier = identifier;
+ }
+ return self;
+}
+
+#pragma mark - Public
+
++ (instancetype)itemWithText:(NSString*)text
+ style:(DialogButtonStyle)style
+ identifier:(id)identifier {
+ return [[[self class] alloc] initWithText:text
+ style:style
+ identifier:identifier];
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698