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

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

Issue 1637043002: Don't try to use ManagePasswordsBubbleModel if the password bubble was closed. (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/passwords_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm b/chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm
index 5877df793ee868dc2443363cd131bfa2f3ead41d..d6df328d5639db6b84eeccd5f14be1511163e7ea 100644
--- a/chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm
@@ -52,6 +52,8 @@
- (void)close {
[currentController_ bubbleWillDisappear];
+ // The bubble is about to be closed. It destroys the model.
+ model_ = nil;
[super close];
}
@@ -60,13 +62,11 @@
currentController_.reset();
if (model_->state() == password_manager::ui::PENDING_PASSWORD_STATE) {
currentController_.reset([[SavePendingPasswordViewController alloc]
- initWithModel:model_
- delegate:self]);
+ initWithDelegate:self]);
} else if (model_->state() ==
password_manager::ui::PENDING_PASSWORD_UPDATE_STATE) {
currentController_.reset([[UpdatePendingPasswordViewController alloc]
- initWithModel:model_
- delegate:self]);
+ initWithDelegate:self]);
} else if (model_->state() == password_manager::ui::CONFIRMATION_STATE) {
currentController_.reset(
[[ManagePasswordsBubbleConfirmationViewController alloc]
@@ -148,6 +148,10 @@
[self close];
}
+- (ManagePasswordsBubbleModel*)model {
+ return model_;
+}
+
@end
@implementation ManagePasswordsBubbleController (Testing)

Powered by Google App Engine
This is Rietveld 408576698