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

Unified Diff: chrome/browser/ui/cocoa/chooser_content_view_cocoa.h

Issue 2086663003: Change ChooserController ownership model (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed temporary unique ptr at ChooserBubbleUiCocoa 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
Index: chrome/browser/ui/cocoa/chooser_content_view_cocoa.h
diff --git a/chrome/browser/ui/cocoa/chooser_content_view_cocoa.h b/chrome/browser/ui/cocoa/chooser_content_view_cocoa.h
index 02eb420faad86f9abd646240082513c28100682b..f9618a74133111173fd4444e9d60a0066b7943a4 100644
--- a/chrome/browser/ui/cocoa/chooser_content_view_cocoa.h
+++ b/chrome/browser/ui/cocoa/chooser_content_view_cocoa.h
@@ -7,8 +7,13 @@
#import <Cocoa/Cocoa.h>
+#include <memory>
+
#include "base/mac/scoped_nsobject.h"
+class ChooserController;
+class TableViewController;
+
// A chooser content view class that user can select an option.
@interface ChooserContentViewCocoa : NSView {
@private
@@ -21,10 +26,14 @@
base::scoped_nsobject<NSBox> separator_;
base::scoped_nsobject<NSTextField> message_;
base::scoped_nsobject<NSButton> helpButton_;
+ std::unique_ptr<ChooserController> chooserController_;
+ std::unique_ptr<TableViewController> tableViewController_;
}
// Designated initializer.
-- (instancetype)initWithChooserTitle:(NSString*)chooserTitle;
+- (instancetype)initWithChooserTitle:(NSString*)chooserTitle
+ chooserController:
+ (std::unique_ptr<ChooserController>)chooserController;
// Creates the title for the chooser.
- (base::scoped_nsobject<NSTextField>)createChooserTitle:(NSString*)title;
@@ -59,6 +68,27 @@
// Gets the "Get help" button.
- (NSButton*)helpButton;
+// The number of options in the |tableView_|.
+- (NSInteger)numberOfOptions;
+
+// The |index|th option string which is listed in the chooser.
+- (NSString*)optionAtIndex:(NSInteger)index;
+
+// Update |tableView_| when chooser options changed.
+- (void)updateTableView;
+
+// Called when the "Connect" button is pressed.
+- (void)accept;
+
+// Called when the "Cancel" button is pressed.
+- (void)cancel;
+
+// Called when the chooser is closed.
+- (void)close;
+
+// Called when the "Get help" button is pressed.
+- (void)onHelpPressed:(id)sender;
+
@end
#endif // CHROME_BROWSER_UI_COCOA_CHOOSER_CONTENT_VIEW_COCOA_H_

Powered by Google App Engine
This is Rietveld 408576698