| Index: chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm
|
| index 287192fdba9a0564527c88669ceb951b5758645c..87b7aab0b6a8df6415be9904b34d66c9f965e4cb 100644
|
| --- a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm
|
| @@ -42,8 +42,9 @@
|
| @end
|
|
|
| @implementation AccountChooserViewController
|
| +@synthesize bridge = bridge_;
|
|
|
| -- (id)initWithBridge:(AccountChooserBridge*)bridge {
|
| +- (instancetype)initWithBridge:(AccountChooserBridge*)bridge {
|
| base::scoped_nsobject<AccountAvatarFetcherManager> avatarManager(
|
| [[AccountAvatarFetcherManager alloc]
|
| initWithRequestContext:bridge->GetRequestContext()]);
|
| @@ -134,12 +135,14 @@
|
| - (BOOL)textView:(NSTextView*)textView
|
| clickedOnLink:(id)link
|
| atIndex:(NSUInteger)charIndex {
|
| - bridge_->GetDialogController()->OnSmartLockLinkClicked();
|
| + if (bridge_ && bridge_->GetDialogController())
|
| + bridge_->GetDialogController()->OnSmartLockLinkClicked();
|
| return YES;
|
| }
|
|
|
| - (void)onCancelClicked:(id)sender {
|
| - bridge_->PerformClose();
|
| + if (bridge_)
|
| + bridge_->PerformClose();
|
| }
|
|
|
| - (void)fetchAvatar:(const GURL&)avatarURL forView:(CredentialItemView*)view {
|
| @@ -197,16 +200,18 @@
|
| - (void)tableViewSelectionDidChange:(NSNotification *)notification {
|
| CredentialItemView* item =
|
| [credentialItems_.get() objectAtIndex:[credentialsView_ selectedRow]];
|
| - bridge_->GetDialogController()->OnChooseCredentials(item.passwordForm,
|
| - item.credentialType);
|
| + if (bridge_ && bridge_->GetDialogController()) {
|
| + bridge_->GetDialogController()->OnChooseCredentials(item.passwordForm,
|
| + item.credentialType);
|
| + }
|
| }
|
|
|
| @end
|
|
|
| @implementation AccountChooserViewController(Testing)
|
|
|
| -- (id)initWithBridge:(AccountChooserBridge*)bridge
|
| - avatarManager:(AccountAvatarFetcherManager*)avatarManager {
|
| +- (instancetype)initWithBridge:(AccountChooserBridge*)bridge
|
| + avatarManager:(AccountAvatarFetcherManager*)avatarManager {
|
| DCHECK(bridge);
|
| if (self = [super initWithNibName:nil bundle:nil]) {
|
| bridge_ = bridge;
|
|
|