Chromium Code Reviews| 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 CHROME_BROWSER_UI_COCOA_EXTENSIONS_CHOOSER_DIALOG_COCOA_CONTROLLER_H_ | |
| 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_CHOOSER_DIALOG_COCOA_CONTROLLER_H_ | |
| 7 | |
| 8 #import <Cocoa/Cocoa.h> | |
| 9 | |
| 10 #include "base/mac/scoped_nsobject.h" | |
| 11 | |
| 12 @class ChooserContentView; | |
| 13 class ChooserController; | |
| 14 class ChooserDialogCocoa; | |
| 15 | |
| 16 // Displays a chooser dialog, and notifies the ChooserController | |
| 17 // of the selected option. | |
| 18 @interface ChooserDialogCocoaController | |
| 19 : NSViewController<NSTableViewDataSource, NSTableViewDelegate> { | |
| 20 base::scoped_nsobject<ChooserContentView> chooserContentView_; | |
| 21 NSTableView* tableView_; // Weak. | |
| 22 NSButton* connectButton_; // Weak. | |
| 23 NSButton* cancelButton_; // Weak. | |
| 24 NSButton* helpButton_; // Weak. | |
| 25 | |
| 26 ChooserDialogCocoa* chooserDialogCocoa_; // Weak. | |
| 27 ChooserController* chooserController_; // Weak. | |
| 28 } | |
| 29 | |
| 30 // Designated initializer. || and || must both be non-nil. | |
| 31 - (instancetype) | |
| 32 initWithChooserDialogCocoa:(ChooserDialogCocoa*)chooserDialogCocoa | |
|
Robert Sesek
2016/05/23 20:13:53
nit: break after the : instead
juncai
2016/05/27 21:30:37
Done.
| |
| 33 initWithChooserController:(ChooserController*)chooserController; | |
|
Robert Sesek
2016/05/23 20:13:53
nit: indent 4
juncai
2016/05/27 21:30:37
Done.
| |
| 34 | |
| 35 // Update |tableView_| when chooser options were initialized. | |
| 36 - (void)onOptionsInitialized; | |
| 37 | |
| 38 // Update |tableView_| when chooser option was added. | |
| 39 - (void)onOptionAdded:(NSInteger)index; | |
| 40 | |
| 41 // Update |tableView_| when chooser option was removed. | |
| 42 - (void)onOptionRemoved:(NSInteger)index; | |
| 43 | |
| 44 // Update |tableView_| when chooser options changed. | |
| 45 - (void)updateTableView; | |
| 46 | |
| 47 // Called when the "Connect" button is pressed. | |
| 48 - (void)onConnect:(id)sender; | |
| 49 | |
| 50 // Called when the "Cancel" button is pressed. | |
| 51 - (void)onCancel:(id)sender; | |
| 52 | |
| 53 // Called when the "Get help" button is pressed. | |
| 54 - (void)onHelpPressed:(id)sender; | |
| 55 | |
| 56 @end | |
| 57 | |
| 58 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_CHOOSER_DIALOG_COCOA_CONTROLLER_H_ | |
| OLD | NEW |