Chromium Code Reviews| Index: ios/chrome/browser/infobars/confirm_infobar_controller.mm |
| diff --git a/ios/chrome/browser/infobars/confirm_infobar_controller.mm b/ios/chrome/browser/infobars/confirm_infobar_controller.mm |
| index 3e72bb6becfecbe6c99cf41f2164783791f500cc..8f3ac3cb8d19c2e07b37560ed2fae18b66381204 100644 |
| --- a/ios/chrome/browser/infobars/confirm_infobar_controller.mm |
| +++ b/ios/chrome/browser/infobars/confirm_infobar_controller.mm |
| @@ -119,8 +119,9 @@ ConfirmInfoBarDelegate::InfoBarButton UITagToButton(NSUInteger tag) { |
| &messageText, 0, _confirmInfobarDelegate->GetLinkText(), msgLink); |
| [view addLabel:base::SysUTF16ToNSString(messageText) |
| - target:self |
| - action:@selector(infobarLinkDidPress:)]; |
| + action:^(NSUInteger tag) { |
| + [self infobarLinkDidPress:tag]; |
|
sdefresne
2017/04/21 14:19:24
This block has a strong reference to "self". Thus
gambard
2017/04/21 14:54:48
Yes, I tried to keep the current behavior.
|
| + }]; |
| } else { |
| NSString* label = |
| base::SysUTF16ToNSString(_confirmInfobarDelegate->GetMessageText()); |
| @@ -147,12 +148,11 @@ ConfirmInfoBarDelegate::InfoBarButton UITagToButton(NSUInteger tag) { |
| } |
| // Title link was clicked. |
| -- (void)infobarLinkDidPress:(NSNumber*)tag { |
| - DCHECK([tag isKindOfClass:[NSNumber class]]); |
| +- (void)infobarLinkDidPress:(NSUInteger)tag { |
| if (!self.delegate) { |
| return; |
| } |
| - if ([tag unsignedIntegerValue] == ConfirmInfoBarUITags::TITLE_LINK) { |
| + if (tag == ConfirmInfoBarUITags::TITLE_LINK) { |
| _confirmInfobarDelegate->LinkClicked( |
| WindowOpenDisposition::NEW_FOREGROUND_TAB); |
| } |