blob: 2765c6b9026e2f929184840440ba8aa67f3d0e63 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/web_view/shell/shell_auth_service.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
// Fake implementation of ShellAuthService.
@implementation ShellAuthService
- (NSArray<CWVIdentity*>*)identities {
return @[];
}
#pragma mark CWVSyncControllerDataSource
- (void)fetchAccessTokenForIdentity:(CWVIdentity*)identity
scopes:(NSArray<NSString*>*)scopes
completionHandler:
(void (^)(NSString* _Nullable accessToken,
NSDate* _Nullable expirationDate,
NSError* _Nullable error))completionHandler {
// Always returns an error.
if (completionHandler) {
completionHandler(
nil, nil,
[NSError errorWithDomain:@"org.chromium.chromewebview.shell"
code:0
userInfo:nil]);
}
}
- (NSArray<CWVIdentity*>*)allKnownIdentities {
return [self identities];
}
- (CWVSyncError)syncErrorForNSError:(NSError*)error
identity:(CWVIdentity*)identity {
return CWVSyncErrorUnexpectedServiceResponse;
}
@end