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

Unified Diff: chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm

Issue 1645503002: Remove dangling ManagePasswordsBubbleModel pointers. Test that different password bubbles don't pin… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/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;

Powered by Google App Engine
This is Rietveld 408576698