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

Unified Diff: chrome/browser/ui/cocoa/passwords/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/pending_password_view_controller.mm
diff --git a/chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm b/chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm
index 588462ac4e3a36c275f01e42eb690b5e82118949..97a838e6b3fae5abf8573b19f2c0dc6f64ffc164 100644
--- a/chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm
+++ b/chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm
@@ -22,18 +22,12 @@ const SkColor kWarmWelcomeColor = SkColorSetRGB(0x64, 0x64, 0x64);
@implementation PendingPasswordViewController
-- (id)initWithModel:(ManagePasswordsBubbleModel*)model
- delegate:(id<ManagePasswordsBubbleContentViewDelegate>)delegate {
- if (([super initWithDelegate:delegate])) {
- model_ = model;
- }
- return self;
-}
-
- (BOOL)textView:(NSTextView*)textView
clickedOnLink:(id)link
atIndex:(NSUInteger)charIndex {
- model_->OnBrandLinkClicked();
+ ManagePasswordsBubbleModel* model = [self model];
+ if (model)
+ model->OnBrandLinkClicked();
[delegate_ viewShouldDismiss];
return YES;
}
@@ -90,8 +84,9 @@ const SkColor kWarmWelcomeColor = SkColorSetRGB(0x64, 0x64, 0x64);
[view addSubview:closeButton_];
// Title.
+ ManagePasswordsBubbleModel* model = [self model];
HyperlinkTextView* titleView = TitleLabelWithLink(
- model_->title(), model_->title_brand_link_range(), self);
+ model->title(), model->title_brand_link_range(), self);
// Force the text to wrap to fit in the bubble size.
int titleRightPadding =
@@ -177,7 +172,7 @@ const SkColor kWarmWelcomeColor = SkColorSetRGB(0x64, 0x64, 0x64);
}
- (ManagePasswordsBubbleModel*)model {
- return model_;
+ return [delegate_ model];
}
@end

Powered by Google App Engine
This is Rietveld 408576698