Chromium Code Reviews| Index: ios/chrome/browser/passwords/update_password_infobar_controller.mm |
| diff --git a/ios/chrome/browser/passwords/update_password_infobar_controller.mm b/ios/chrome/browser/passwords/update_password_infobar_controller.mm |
| index 656b3bb2f88bf4630890b2e793e8359657edceeb..102624fb6c70d87ae2db4d3ae05b50c502970413 100644 |
| --- a/ios/chrome/browser/passwords/update_password_infobar_controller.mm |
| +++ b/ios/chrome/browser/passwords/update_password_infobar_controller.mm |
| @@ -4,6 +4,7 @@ |
| #import "ios/chrome/browser/passwords/update_password_infobar_controller.h" |
| +#include "base/ios/weak_nsobject.h" |
| #import "base/mac/objc_property_releaser.h" |
| #include "base/strings/string_util.h" |
| #include "base/strings/sys_string_conversions.h" |
| @@ -61,9 +62,12 @@ - (void)updateInfobarLabel:(InfoBarView*)view { |
| &messageText, 0, _delegate->selected_account(), usernameLink); |
| } |
| + base::WeakNSObject<UpdatePasswordInfoBarController> weakSelf(self); |
| [view addLabel:base::SysUTF16ToNSString(messageText) |
| action:^(NSUInteger tag) { |
| - [self infobarLinkDidPress:tag]; |
| + base::scoped_nsobject<BeforeTranslateInfoBarController> strongSelf( |
|
sdefresne
2017/06/12 14:14:24
nit: I think it is okay to do the following
[we
|
| + [weakSelf retain]); |
| + [strongSelf infobarLinkDidPress:tag]; |
| }]; |
| } |