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

Unified Diff: ios/chrome/browser/infobars/confirm_infobar_controller.mm

Issue 2831293002: Change target+selector for block in InfoBarView (Closed)
Patch Set: Address comment Created 3 years, 8 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
« no previous file with comments | « no previous file | ios/chrome/browser/infobars/confirm_infobar_controller+protected.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | ios/chrome/browser/infobars/confirm_infobar_controller+protected.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698