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. |chooserDialogCocoa| and |chooserController| |
| 31 // must both be non-nil. |
| 32 - (instancetype) |
| 33 initWithChooserDialogCocoa:(ChooserDialogCocoa*)chooserDialogCocoa |
| 34 chooserController:(ChooserController*)chooserController; |
| 35 |
| 36 // Update |tableView_| when chooser options were initialized. |
| 37 - (void)onOptionsInitialized; |
| 38 |
| 39 // Update |tableView_| when chooser option was added. |
| 40 - (void)onOptionAdded:(NSInteger)index; |
| 41 |
| 42 // Update |tableView_| when chooser option was removed. |
| 43 - (void)onOptionRemoved:(NSInteger)index; |
| 44 |
| 45 // Update |tableView_| when chooser options changed. |
| 46 - (void)updateTableView; |
| 47 |
| 48 // Called when the "Connect" button is pressed. |
| 49 - (void)onConnect:(id)sender; |
| 50 |
| 51 // Called when the "Cancel" button is pressed. |
| 52 - (void)onCancel:(id)sender; |
| 53 |
| 54 // Called when the "Get help" button is pressed. |
| 55 - (void)onHelpPressed:(id)sender; |
| 56 |
| 57 // Gets the |chooserContentView_|. For testing only. |
| 58 - (ChooserContentView*)chooserContentView; |
| 59 |
| 60 @end |
| 61 |
| 62 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_CHOOSER_DIALOG_COCOA_CONTROLLER_H_ |
OLD | NEW |