OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_interact
ion_manager.h" | 5 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_interact
ion_manager.h" |
6 | 6 |
7 #include "base/mac/scoped_block.h" | 7 #include "base/mac/scoped_block.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" | |
10 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.
h" | 9 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.
h" |
11 #include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" | 10 #include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" |
12 | 11 |
13 @interface FakeAddAccountViewController : UIViewController { | 12 @interface FakeAddAccountViewController : UIViewController { |
14 FakeChromeIdentityInteractionManager* _manager; // Weak. | 13 FakeChromeIdentityInteractionManager* _manager; // Weak. |
15 base::scoped_nsobject<UIButton> _cancelButton; | 14 base::scoped_nsobject<UIButton> _cancelButton; |
16 base::scoped_nsobject<UIButton> _signInButton; | 15 base::scoped_nsobject<UIButton> _signInButton; |
17 } | 16 } |
18 @end | 17 @end |
19 | 18 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 if (_completionCallback) { | 154 if (_completionCallback) { |
156 // Ensure self is not destroyed in the callback. | 155 // Ensure self is not destroyed in the callback. |
157 base::scoped_nsobject<FakeChromeIdentityInteractionManager> strongSelf( | 156 base::scoped_nsobject<FakeChromeIdentityInteractionManager> strongSelf( |
158 [self retain]); | 157 [self retain]); |
159 _completionCallback.get()(error ? nil : _fakeIdentity, error); | 158 _completionCallback.get()(error ? nil : _fakeIdentity, error); |
160 _completionCallback.reset(); | 159 _completionCallback.reset(); |
161 } | 160 } |
162 } | 161 } |
163 | 162 |
164 - (NSError*)canceledError { | 163 - (NSError*)canceledError { |
165 ios::SigninErrorProvider* provider = | 164 ios::SigninErrorProvider* provider = ios::GetSigninErrorProvider(); |
166 ios::GetChromeBrowserProvider()->GetSigninErrorProvider(); | |
167 return [NSError errorWithDomain:provider->GetSigninErrorDomain() | 165 return [NSError errorWithDomain:provider->GetSigninErrorDomain() |
168 code:provider->GetCode(ios::SigninError::CANCELED) | 166 code:provider->GetCode(ios::SigninError::CANCELED) |
169 userInfo:nil]; | 167 userInfo:nil]; |
170 } | 168 } |
171 | 169 |
172 @end | 170 @end |
OLD | NEW |