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

Unified Diff: ios/chrome/browser/translate/before_translate_infobar_controller.mm

Issue 2933833002: [iOS] Break retain cycle in InfoBars. (Closed)
Patch Set: Addressed comments. Created 3 years, 6 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 | « ios/chrome/browser/passwords/update_password_infobar_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 462ef17ab43d714057479988d2f310030333c780..59e97ee1c5b0853a56195288bf10ffb6af1277fc 100644
--- a/ios/chrome/browser/translate/before_translate_infobar_controller.mm
+++ b/ios/chrome/browser/translate/before_translate_infobar_controller.mm
@@ -7,6 +7,7 @@
#include <stddef.h>
#import <UIKit/UIKit.h>
+#include "base/ios/weak_nsobject.h"
#include "base/logging.h"
#include "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
@@ -172,9 +173,11 @@ - (void)updateInfobarLabelOnView:(InfoBarView*)view {
NSString* label =
l10n_util::GetNSStringF(IDS_TRANSLATE_INFOBAR_BEFORE_MESSAGE_IOS,
originalLanguageWithLink, targetLanguageWithLink);
+
+ base::WeakNSObject<BeforeTranslateInfoBarController> weakSelf(self);
[view addLabel:label
action:^(NSUInteger tag) {
- [self infobarLinkDidPress:tag];
+ [weakSelf infobarLinkDidPress:tag];
}];
}
« no previous file with comments | « ios/chrome/browser/passwords/update_password_infobar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698