Index: ios/clean/chrome/browser/ui/dialogs/dialog_button_item.h |
diff --git a/ios/clean/chrome/browser/ui/dialogs/dialog_button_item.h b/ios/clean/chrome/browser/ui/dialogs/dialog_button_item.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fa60bd337621fce333dd6fdf72861b0985eba63c |
--- /dev/null |
+++ b/ios/clean/chrome/browser/ui/dialogs/dialog_button_item.h |
@@ -0,0 +1,35 @@ |
+// 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. |
+ |
+#ifndef IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_DIALOG_BUTTON_ITEM_H_ |
+#define IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_DIALOG_BUTTON_ITEM_H_ |
+ |
+#import <UIKit/UIKit.h> |
+ |
+// Enum type to describe the style of buttons to use. |
+enum class DialogButtonStyle : short { DEFAULT, CANCEL, DESTRUCTIVE }; |
marq (ping after 24h)
2017/06/14 10:52:14
Define the semantics of each value.
Set an explic
kkhorimoto
2017/06/23 06:24:17
Done. I definitely think we should be using enum
|
+ |
+// An object encapsulating the data necessary to set up a dialog's text field. |
marq (ping after 24h)
2017/06/14 10:52:14
Class is for a 'button item', but the comment refe
kkhorimoto
2017/06/23 06:24:17
Done.
|
+@interface DialogButtonItem : NSObject |
+ |
+// Factory method for item creation. |
marq (ping after 24h)
2017/06/14 10:52:14
Document the preconditions you are DCHECKING for i
kkhorimoto
2017/06/23 06:24:17
Done.
|
++ (instancetype)itemWithText:(NSString*)text |
+ style:(DialogButtonStyle)style |
+ tag:(id)tag; |
+ |
+// DialogTextFieldItems should be created through the factory method. |
+- (instancetype)init NS_UNAVAILABLE; |
+ |
+// The default text to display in the text field, if any. |
+@property(nonatomic, readonly, strong) NSString* text; |
+ |
+// The placehodler text to display in the text field, if any. |
+@property(nonatomic, readonly) DialogButtonStyle style; |
+ |
+// The tag passed to the factory method. This is used to identify the button |
+// tapped for DialogDismissalCommands. |
+@property(nonatomic, readonly, strong) id tag; |
+ |
+@end |
+#endif // IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_DIALOG_BUTTON_ITEM_H_ |