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

Unified Diff: ios/clean/chrome/browser/ui/dialogs/dialog_button_configuration.h

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.h
diff --git a/ios/clean/chrome/browser/ui/dialogs/dialog_button_configuration.h b/ios/clean/chrome/browser/ui/dialogs/dialog_button_configuration.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed264b1fa3d80069af331557ba6b6c12432bdf58
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/dialogs/dialog_button_configuration.h
@@ -0,0 +1,44 @@
+// 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_CONFIGURATION_H_
+#define IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_DIALOG_BUTTON_CONFIGURATION_H_
+
+#import <UIKit/UIKit.h>
+
+// Enum type to describe the style of buttons to use.
+enum class DialogButtonStyle : short {
+ DEFAULT = 0, // Uses default button styling.
+
+ CANCEL, // Uses styling to indicates that the button cancels the
+ // current action, and leaves things unchanged.
+
+ DESTRUCTIVE // Uses styling that indicates that the button might change or
+ // delete data.
+};
+
+// An object encapsulating the data necessary to set up a dialog button.
+@interface DialogButtonConfiguration : NSObject
+
+// Factory method for item creation. |text| must be non-empty, and |identifier|
+// must be non-nil.
++ (instancetype)itemWithText:(NSString*)text
+ style:(DialogButtonStyle)style
+ identifier:(id)identifier;
+
+// DialogTextFieldConfigurations 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, copy) NSString* text;
+
+// The placehodler text to display in the text field, if any.
+@property(nonatomic, readonly) DialogButtonStyle style;
+
+// The ID passed to the factory method. This is used to identify the button
+// tapped for DialogDismissalCommands.
+@property(nonatomic, readonly, strong) id identifier;
+
+@end
+#endif // IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_DIALOG_BUTTON_CONFIGURATION_H_
« no previous file with comments | « ios/clean/chrome/browser/ui/dialogs/BUILD.gn ('k') | ios/clean/chrome/browser/ui/dialogs/dialog_button_configuration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698