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

Unified Diff: chrome/browser/ui/cocoa/passwords/update_pending_password_view_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/update_pending_password_view_controller.mm
diff --git a/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller.mm b/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller.mm
index 4bf4d420b9630ec20b934121e8894e2dbace8a36..186e38a66bdc9eb5f459b360554fcd02225638b6 100644
--- a/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller.mm
+++ b/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller.mm
@@ -17,30 +17,28 @@
@implementation UpdatePendingPasswordViewController
-- (UpdatePendingPasswordViewController*)
-initWithModel:(ManagePasswordsBubbleModel*)model
- delegate:(id<ManagePasswordsBubbleContentViewDelegate>)delegate {
- self = [super initWithModel:model delegate:delegate];
- return self;
-}
-
- (NSButton*)defaultButton {
return updateButton_;
}
- (void)onUpdateClicked:(id)sender {
- if (passwordWithUsernameSelectionItem_) {
- // Multi account case.
- self.model->OnUpdateClicked(
- *[passwordWithUsernameSelectionItem_ getSelectedCredentials]);
- } else {
- self.model->OnUpdateClicked(self.model->pending_password());
+ ManagePasswordsBubbleModel* model = [self model];
+ if (model) {
+ if (passwordWithUsernameSelectionItem_) {
+ // Multi account case.
+ model->OnUpdateClicked(
+ *[passwordWithUsernameSelectionItem_ getSelectedCredentials]);
+ } else {
+ model->OnUpdateClicked(model->pending_password());
+ }
}
[delegate_ viewShouldDismiss];
}
- (void)onNopeClicked:(id)sender {
- self.model->OnNopeUpdateClicked();
+ ManagePasswordsBubbleModel* model = [self model];
+ if (model)
+ model->OnNopeUpdateClicked();
[delegate_ viewShouldDismiss];
}

Powered by Google App Engine
This is Rietveld 408576698