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

Unified Diff: ios/chrome/browser/infobars/infobar_picker_view_controller.h

Issue 2107743002: Add InfoBarPickerController for displaying a picker view from an infobar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_passwords_strings
Patch Set: Rename InfoBarPickerController to InfoBarPickerViewController Created 4 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
« no previous file with comments | « ios/chrome/browser/BUILD.gn ('k') | ios/chrome/browser/infobars/infobar_picker_view_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/infobars/infobar_picker_view_controller.h
diff --git a/ios/chrome/browser/infobars/infobar_picker_view_controller.h b/ios/chrome/browser/infobars/infobar_picker_view_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..0bfd245bcbe1da1deec2a12c0b8d7d6a8dc8550e
--- /dev/null
+++ b/ios/chrome/browser/infobars/infobar_picker_view_controller.h
@@ -0,0 +1,47 @@
+// Copyright 2016 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_CHROME_BROWSER_INFOBARS_INFOBAR_PICKER_VIEW_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_PICKER_VIEW_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+
+@class InfoBarPickerViewController;
+
+// Delegate protocol for InfoBarPickerViewController.
+@protocol InfoBarPickerViewControllerDelegate<NSObject>
+// Returns text for |row| in the picker.
+- (NSString*)infoBarPickerViewController:
+ (InfoBarPickerViewController*)controller
+ textForRow:(NSInteger)row;
+// Returns the number of rows in the picker.
+- (NSInteger)infoBarPickerViewControllerNumberOfRows:
+ (InfoBarPickerViewController*)controller;
+// Returns the index of the row to be initially selected in the picker.
+- (NSInteger)infoBarPickerViewControllerInitialRow:
+ (InfoBarPickerViewController*)controller;
+@optional
+// If implemented, returns the index of the row to be disabled in the picker.
+- (NSInteger)infoBarPickerViewControllerDisabledRow:
+ (InfoBarPickerViewController*)controller;
+@end
+
+// View controller for displaying a UIPickerView topped by a UINavigationBar
+// displaying "Done" on the right and "Cancel" on the left.
+@interface InfoBarPickerViewController : UIViewController
+// The picker view displayed by the InfoBarPickerViewController.
+@property(nonatomic, retain) UIPickerView* pickerView;
+@property(nonatomic, weak) id<InfoBarPickerViewControllerDelegate> delegate;
+// Sets target and action for the "Done" button.
+- (void)setDoneTarget:(id)target action:(SEL)action;
+// Sets target and action for the "Cancel" button.
+- (void)setCancelTarget:(id)target action:(SEL)action;
+@end
+
+@interface InfoBarPickerViewController ()
+// The displayed UINavigationBar. Exposed for testing.
+@property(nonatomic, retain) UINavigationBar* navigationBar;
+@end
+
+#endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_PICKER_VIEW_CONTROLLER_H_
« no previous file with comments | « ios/chrome/browser/BUILD.gn ('k') | ios/chrome/browser/infobars/infobar_picker_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698