OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_DIALOG_BUTTON_ITEM_H_ | |
6 #define IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_DIALOG_BUTTON_ITEM_H_ | |
7 | |
8 #import <UIKit/UIKit.h> | |
9 | |
10 // Enum type to describe the style of buttons to use. | |
11 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
| |
12 | |
13 // 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.
| |
14 @interface DialogButtonItem : NSObject | |
15 | |
16 // 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.
| |
17 + (instancetype)itemWithText:(NSString*)text | |
18 style:(DialogButtonStyle)style | |
19 tag:(id)tag; | |
20 | |
21 // DialogTextFieldItems should be created through the factory method. | |
22 - (instancetype)init NS_UNAVAILABLE; | |
23 | |
24 // The default text to display in the text field, if any. | |
25 @property(nonatomic, readonly, strong) NSString* text; | |
26 | |
27 // The placehodler text to display in the text field, if any. | |
28 @property(nonatomic, readonly) DialogButtonStyle style; | |
29 | |
30 // The tag passed to the factory method. This is used to identify the button | |
31 // tapped for DialogDismissalCommands. | |
32 @property(nonatomic, readonly, strong) id tag; | |
33 | |
34 @end | |
35 #endif // IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_DIALOG_BUTTON_ITEM_H_ | |
OLD | NEW |