Index: ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm |
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm |
index 93de808a526ed48bee03504b7827538ec3b4c45a..d4cf71492ba808922492268638fe466ce00993ce 100644 |
--- a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm |
+++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm |
@@ -5,21 +5,20 @@ |
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.h" |
#include "base/mac/scoped_block.h" |
-#include "base/mac/scoped_nsobject.h" |
#import "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h" |
#include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" |
@interface FakeAddAccountViewController : UIViewController { |
FakeChromeIdentityInteractionManager* _manager; // Weak. |
- base::scoped_nsobject<UIButton> _cancelButton; |
- base::scoped_nsobject<UIButton> _signInButton; |
+ UIButton* _cancelButton; |
+ UIButton* _signInButton; |
} |
@end |
@interface FakeChromeIdentityInteractionManager () { |
- base::mac::ScopedBlock<SigninCompletionCallback> _completionCallback; |
- base::scoped_nsobject<UIViewController> _viewController; |
+ SigninCompletionCallback _completionCallback; |
+ UIViewController* _viewController; |
BOOL _isCanceling; |
} |
@@ -56,14 +55,14 @@ |
// Obnoxious color, this is a test screen. |
self.view.backgroundColor = [UIColor magentaColor]; |
- _signInButton.reset([[UIButton buttonWithType:UIButtonTypeCustom] retain]); |
+ _signInButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; |
[_signInButton setTitle:@"Sign in" forState:UIControlStateNormal]; |
[_signInButton addTarget:self |
action:@selector(didTapSignIn:) |
forControlEvents:UIControlEventTouchUpInside]; |
[self.view addSubview:_signInButton]; |
- _cancelButton.reset([[UIButton buttonWithType:UIButtonTypeCustom] retain]); |
+ _cancelButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; |
[_cancelButton setTitle:@"Cancel" forState:UIControlStateNormal]; |
[_cancelButton setAccessibilityIdentifier:@"cancel"]; |
[_cancelButton addTarget:self |
@@ -103,9 +102,9 @@ |
} |
- (void)addAccountWithCompletion:(SigninCompletionCallback)completion { |
- _completionCallback.reset(completion, base::scoped_policy::RETAIN); |
- _viewController.reset( |
- [[FakeAddAccountViewController alloc] initWithInteractionManager:self]); |
+ _completionCallback = [completion copy]; |
+ _viewController = |
+ [[FakeAddAccountViewController alloc] initWithInteractionManager:self]; |
[self.delegate interactionManager:self |
presentViewController:_viewController |
animated:YES |
@@ -152,13 +151,15 @@ |
} |
- (void)runCompletionCallbackWithError:(NSError*)error { |
- _viewController.reset(); |
+ _viewController = nil; |
if (_completionCallback) { |
// Ensure self is not destroyed in the callback. |
- base::scoped_nsobject<FakeChromeIdentityInteractionManager> strongSelf( |
- [self retain]); |
- _completionCallback.get()(error ? nil : _fakeIdentity, error); |
- _completionCallback.reset(); |
+#pragma clang diagnostic push |
+#pragma clang diagnostic ignored "-Wunused-variable" |
+ FakeChromeIdentityInteractionManager* strongSelf = self; |
+#pragma clang diagnostic pop |
+ _completionCallback(error ? nil : _fakeIdentity, error); |
+ _completionCallback = nil; |
} |
} |