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

Unified Diff: ios/chrome/browser/passwords/update_password_infobar_controller.mm

Issue 2127793002: Retain coordinator and update label in UpdatePasswordInfoBarController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Retain coordinator and update label in UpdatePasswordInfoBarController Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/passwords/update_password_infobar_controller.mm
diff --git a/ios/chrome/browser/passwords/update_password_infobar_controller.mm b/ios/chrome/browser/passwords/update_password_infobar_controller.mm
index 5eac335563f82b0286e2cbc4c8e263f11e4fae8e..949a375d87dcd26fbbbc891a95db8bdbaf82e3d7 100644
--- a/ios/chrome/browser/passwords/update_password_infobar_controller.mm
+++ b/ios/chrome/browser/passwords/update_password_infobar_controller.mm
@@ -4,6 +4,7 @@
#import "ios/chrome/browser/passwords/update_password_infobar_controller.h"
+#import "base/mac/objc_property_releaser.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "ios/chrome/browser/infobars/confirm_infobar_controller+protected.h"
@@ -18,12 +19,26 @@ NSUInteger kAccountTag = 10;
}
@interface UpdatePasswordInfoBarController ()<SelectorCoordinatorDelegate> {
+ base::mac::ObjCPropertyReleaser
+ _propertyReleaser_UpdatePasswordInfoBarController;
IOSChromeUpdatePasswordInfoBarDelegate* _delegate;
}
+@property(nonatomic, retain) SelectorCoordinator* selectorCoordinator;
@end
@implementation UpdatePasswordInfoBarController
+@synthesize selectorCoordinator = _selectorCoordinator;
+
+- (instancetype)initWithDelegate:(InfoBarViewDelegate*)delegate {
+ self = [super initWithDelegate:delegate];
+ if (self) {
+ _propertyReleaser_UpdatePasswordInfoBarController.Init(
+ self, [UpdatePasswordInfoBarController class]);
+ }
+ return self;
+}
+
- (base::scoped_nsobject<UIView<InfoBarViewProtocol>>)
viewForDelegate:(IOSChromeUpdatePasswordInfoBarDelegate*)delegate
frame:(CGRect)frame {
@@ -58,13 +73,13 @@ viewForDelegate:(IOSChromeUpdatePasswordInfoBarDelegate*)delegate
UIViewController* baseViewController =
[[UIApplication sharedApplication] keyWindow].rootViewController;
- SelectorCoordinator* selectorCoordinator = [[[SelectorCoordinator alloc]
- initWithBaseViewController:baseViewController] autorelease];
- selectorCoordinator.delegate = self;
- selectorCoordinator.options = [_delegate->GetAccounts() copy];
- selectorCoordinator.defaultOption =
+ self.selectorCoordinator = [[SelectorCoordinator alloc]
+ initWithBaseViewController:baseViewController];
+ self.selectorCoordinator.delegate = self;
+ self.selectorCoordinator.options = [_delegate->GetAccounts() copy];
+ self.selectorCoordinator.defaultOption =
base::SysUTF16ToNSString(_delegate->selected_account());
- [selectorCoordinator start];
+ [self.selectorCoordinator start];
}
#pragma mark SelectorCoordinatorDelegate
@@ -72,6 +87,7 @@ viewForDelegate:(IOSChromeUpdatePasswordInfoBarDelegate*)delegate
- (void)selectorCoordinator:(SelectorCoordinator*)coordinator
didCompleteWithSelection:(NSString*)selection {
_delegate->set_selected_account(base::SysNSStringToUTF16(selection));
+ [self updateInfobarLabel:self.view];
}
@end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698