Chromium Code Reviews| Index: chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h |
| diff --git a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h |
| index 5ca1d70d2ee61473f2e2d774ce58debe0f79f2c5..139c2b9b27fac35c073fa15f01a011aa1abd0b2e 100644 |
| --- a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h |
| +++ b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h |
| @@ -8,13 +8,14 @@ |
| #import <Cocoa/Cocoa.h> |
| #include "base/mac/scoped_nsobject.h" |
| -#import "chrome/browser/ui/cocoa/passwords/base_passwords_content_view_controller.h" |
| #import "chrome/browser/ui/cocoa/passwords/credential_item_view.h" |
| @class AccountAvatarFetcherManager; |
| -@class BubbleCombobox; |
| -class ManagePasswordsBubbleModel; |
| -@class ManagePasswordCredentialItemViewController; |
| + |
| +namespace net { |
| +class URLRequestContextGetter; |
| +} |
| +class PasswordDialogController; |
|
vabr (Chromium)
2016/01/21 10:02:10
nit: I would move line 18 above the "namespace net
vasilii
2016/01/21 12:48:50
Done.
|
| // A custom cell that displays a credential item in an NSTableView. |
| @interface CredentialItemCell : NSCell |
| @@ -22,25 +23,49 @@ class ManagePasswordsBubbleModel; |
| @property(nonatomic, readonly) CredentialItemView* view; |
| @end |
| +// An interface for the bridge between AccountChooserViewController and platform |
| +// independent UI code. |
| +class AccountChooserBridge { |
| + public: |
| + // Closes the dialog. |
| + virtual void PerformClose() = 0; |
| + |
| + // Returns the controller containing the data. |
| + virtual PasswordDialogController* GetDialogController() = 0; |
| + |
| + // Returns the request context for fetching the avatars. |
| + virtual net::URLRequestContextGetter* GetRequestContext() const = 0; |
| + protected: |
|
vabr (Chromium)
2016/01/21 10:02:09
nit: Blank line above.
vasilii
2016/01/21 12:48:50
Done.
|
| + virtual ~AccountChooserBridge() = default; |
| +}; |
| + |
| // Manages a view that shows a list of credentials that can be used for |
| // authentication to a site. |
| -@interface ManagePasswordsBubbleAccountChooserViewController |
| - : ManagePasswordsBubbleContentViewController<CredentialItemDelegate, |
| - NSTableViewDataSource, |
| - NSTableViewDelegate> { |
| +@interface AccountChooserViewController |
| + : NSViewController<CredentialItemDelegate, |
| + NSTableViewDataSource, |
| + NSTableViewDelegate, |
| + NSTextViewDelegate> { |
| @private |
| - ManagePasswordsBubbleModel* model_; // Weak. |
| + AccountChooserBridge* bridge_; // Weak. |
| NSButton* cancelButton_; // Weak. |
| - BubbleCombobox* moreButton_; // Weak. |
| NSTableView* credentialsView_; // Weak. |
| + NSTextView* titleView_; // Weak. |
| base::scoped_nsobject<NSArray> credentialItems_; |
| base::scoped_nsobject<AccountAvatarFetcherManager> avatarManager_; |
| } |
| // Initializes a new account chooser and populates it with the credentials |
| -// stored in |model|. Designated initializer. |
| -- (id)initWithModel:(ManagePasswordsBubbleModel*)model |
| - delegate:(id<ManagePasswordsBubbleContentViewDelegate>)delegate; |
| +// stored in |bridge->controller()|. |
| +- (id)initWithBridge:(AccountChooserBridge*)bridge; |
| +@end |
| + |
| +@interface AccountChooserViewController(Testing) |
| +- (id)initWithBridge:(AccountChooserBridge*)bridge |
| + avatarManager:(AccountAvatarFetcherManager*)avatarManager; |
| +@property(nonatomic, readonly) NSButton* cancelButton; |
| +@property(nonatomic, readonly) NSTableView* credentialsView; |
| +@property(nonatomic, readonly) NSTextView* titleView; |
| @end |
| #endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_ACCOUNT_CHOOSER_VIEW_CONTROLLER_H_ |