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" |
9 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.
h" | 10 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.
h" |
10 #include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" | 11 #include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" |
11 | 12 |
12 @interface FakeAddAccountViewController : UIViewController { | 13 @interface FakeAddAccountViewController : UIViewController { |
13 FakeChromeIdentityInteractionManager* _manager; // Weak. | 14 FakeChromeIdentityInteractionManager* _manager; // Weak. |
14 base::scoped_nsobject<UIButton> _cancelButton; | 15 base::scoped_nsobject<UIButton> _cancelButton; |
15 base::scoped_nsobject<UIButton> _signInButton; | 16 base::scoped_nsobject<UIButton> _signInButton; |
16 } | 17 } |
17 @end | 18 @end |
18 | 19 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 if (_completionCallback) { | 155 if (_completionCallback) { |
155 // Ensure self is not destroyed in the callback. | 156 // Ensure self is not destroyed in the callback. |
156 base::scoped_nsobject<FakeChromeIdentityInteractionManager> strongSelf( | 157 base::scoped_nsobject<FakeChromeIdentityInteractionManager> strongSelf( |
157 [self retain]); | 158 [self retain]); |
158 _completionCallback.get()(error ? nil : _fakeIdentity, error); | 159 _completionCallback.get()(error ? nil : _fakeIdentity, error); |
159 _completionCallback.reset(); | 160 _completionCallback.reset(); |
160 } | 161 } |
161 } | 162 } |
162 | 163 |
163 - (NSError*)canceledError { | 164 - (NSError*)canceledError { |
164 ios::SigninErrorProvider* provider = ios::GetSigninErrorProvider(); | 165 ios::SigninErrorProvider* provider = |
| 166 ios::GetChromeBrowserProvider()->GetSigninErrorProvider(); |
165 return [NSError errorWithDomain:provider->GetSigninErrorDomain() | 167 return [NSError errorWithDomain:provider->GetSigninErrorDomain() |
166 code:provider->GetCode(ios::SigninError::CANCELED) | 168 code:provider->GetCode(ios::SigninError::CANCELED) |
167 userInfo:nil]; | 169 userInfo:nil]; |
168 } | 170 } |
169 | 171 |
170 @end | 172 @end |
OLD | NEW |