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

Unified Diff: ios/chrome/browser/translate/before_translate_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
Index: ios/chrome/browser/translate/before_translate_infobar_controller.mm
diff --git a/ios/chrome/browser/translate/before_translate_infobar_controller.mm b/ios/chrome/browser/translate/before_translate_infobar_controller.mm
index 821d1d53385dd006414d3c1f7989ae650d4d587b..462ef17ab43d714057479988d2f310030333c780 100644
--- a/ios/chrome/browser/translate/before_translate_infobar_controller.mm
+++ b/ios/chrome/browser/translate/before_translate_infobar_controller.mm
@@ -97,7 +97,7 @@ NSTimeInterval kPickerAnimationDurationInSeconds = 0.2;
// Action for any of the user defined buttons.
- (void)infoBarButtonDidPress:(id)sender;
// Action for any of the user defined links.
-- (void)infobarLinkDidPress:(NSNumber*)tag;
+- (void)infobarLinkDidPress:(NSUInteger)tag;
// Action for the language selection "Done" button.
- (void)languageSelectionDone;
// Dismisses the language selection view.
@@ -172,7 +172,10 @@ NSTimeInterval kPickerAnimationDurationInSeconds = 0.2;
NSString* label =
l10n_util::GetNSStringF(IDS_TRANSLATE_INFOBAR_BEFORE_MESSAGE_IOS,
originalLanguageWithLink, targetLanguageWithLink);
- [view addLabel:label target:self action:@selector(infobarLinkDidPress:)];
+ [view addLabel:label
+ action:^(NSUInteger tag) {
+ [self infobarLinkDidPress:tag];
+ }];
}
- (void)languageSelectionDone {
@@ -246,9 +249,8 @@ NSTimeInterval kPickerAnimationDurationInSeconds = 0.2;
}
}
-- (void)infobarLinkDidPress:(NSNumber*)tag {
- DCHECK([tag isKindOfClass:[NSNumber class]]);
- _languageSelectionType = [tag unsignedIntegerValue];
+- (void)infobarLinkDidPress:(NSUInteger)tag {
+ _languageSelectionType = tag;
DCHECK(_languageSelectionType ==
TranslateInfoBarIOSTag::BEFORE_SOURCE_LANGUAGE ||
_languageSelectionType ==

Powered by Google App Engine
This is Rietveld 408576698