Index: ios/chrome/browser/translate/after_translate_infobar_controller.mm |
diff --git a/ios/chrome/browser/translate/after_translate_infobar_controller.mm b/ios/chrome/browser/translate/after_translate_infobar_controller.mm |
index bd7a5795d1030a1da8618a67d4b15aa79540b642..8ec9e2d215fe7904a042c3a32828c4cea0122f3d 100644 |
--- a/ios/chrome/browser/translate/after_translate_infobar_controller.mm |
+++ b/ios/chrome/browser/translate/after_translate_infobar_controller.mm |
@@ -4,6 +4,7 @@ |
#include "ios/chrome/browser/translate/after_translate_infobar_controller.h" |
+#include "base/mac/scoped_nsobject.h" |
#include "base/strings/sys_string_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#include "components/strings/grit/components_strings.h" |
@@ -29,9 +30,9 @@ |
#pragma mark - |
#pragma mark InfoBarControllerProtocol |
-- (base::scoped_nsobject<UIView<InfoBarViewProtocol>>) |
- viewForDelegate:(infobars::InfoBarDelegate*)delegate |
- frame:(CGRect)frame { |
+- (UIView<InfoBarViewProtocol>*)viewForDelegate: |
+ (infobars::InfoBarDelegate*)delegate |
+ frame:(CGRect)frame { |
base::scoped_nsobject<UIView<InfoBarViewProtocol>> infoBarView; |
_translateInfoBarDelegate = delegate->AsTranslateInfoBarDelegate(); |
DCHECK(_translateInfoBarDelegate); |
@@ -89,7 +90,7 @@ |
target:self |
action:@selector(infoBarSwitchDidPress:)]; |
} |
- return infoBarView; |
+ return [[infoBarView retain] autorelease]; |
} |
#pragma mark - Handling of User Events |