| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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_CHROME_BROWSER_INFOBARS_INFOBAR_PICKER_VIEW_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_PICKER_VIEW_CONTROLLER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 @class InfoBarPickerViewController; |
| 11 |
| 12 // Delegate protocol for InfoBarPickerViewController. |
| 13 @protocol InfoBarPickerViewControllerDelegate<NSObject> |
| 14 // Returns text for |row| in the picker. |
| 15 - (NSString*)infoBarPickerViewController: |
| 16 (InfoBarPickerViewController*)controller |
| 17 textForRow:(NSInteger)row; |
| 18 // Returns the number of rows in the picker. |
| 19 - (NSInteger)infoBarPickerViewControllerNumberOfRows: |
| 20 (InfoBarPickerViewController*)controller; |
| 21 // Returns the index of the row to be initially selected in the picker. |
| 22 - (NSInteger)infoBarPickerViewControllerInitialRow: |
| 23 (InfoBarPickerViewController*)controller; |
| 24 @optional |
| 25 // If implemented, returns the index of the row to be disabled in the picker. |
| 26 - (NSInteger)infoBarPickerViewControllerDisabledRow: |
| 27 (InfoBarPickerViewController*)controller; |
| 28 @end |
| 29 |
| 30 // View controller for displaying a UIPickerView topped by a UINavigationBar |
| 31 // displaying "Done" on the right and "Cancel" on the left. |
| 32 @interface InfoBarPickerViewController : UIViewController |
| 33 // The picker view displayed by the InfoBarPickerViewController. |
| 34 @property(nonatomic, retain) UIPickerView* pickerView; |
| 35 @property(nonatomic, weak) id<InfoBarPickerViewControllerDelegate> delegate; |
| 36 // Sets target and action for the "Done" button. |
| 37 - (void)setDoneTarget:(id)target action:(SEL)action; |
| 38 // Sets target and action for the "Cancel" button. |
| 39 - (void)setCancelTarget:(id)target action:(SEL)action; |
| 40 @end |
| 41 |
| 42 @interface InfoBarPickerViewController () |
| 43 // The displayed UINavigationBar. Exposed for testing. |
| 44 @property(nonatomic, retain) UINavigationBar* navigationBar; |
| 45 @end |
| 46 |
| 47 #endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_PICKER_VIEW_CONTROLLER_H_ |
| OLD | NEW |