Commit 9a307bb1 authored by David Jean's avatar David Jean Committed by Commit Bot

[ios] Update cred ext account verification api

New simpler two-step api.

Bug: 1049638
Change-Id: I8490144f181e140a909d3a740be9035ef0be1465
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095056
Commit-Queue: David Jean <djean@chromium.org>
Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750527}
parent 2c53f9c8
......@@ -11,12 +11,18 @@
// as @optional, until implemented in all replacement providers.
@protocol AccountVerificationProvider
// Checks if the given |accountID| is valid, in the sense of
// credential provider extension should provide or ignore credentials
// associated with this account. Completes with YES if account is valid or
// Completes with a validationID (or nil) that can be used with
// |validateValidationID:completionHandler:| at a later time.
- (void)validationIDForAccountID:(NSString*)accountID
completionHandler:
(void (^)(NSString*, NSError*))completionHandler;
// Checks if the given |validationID| is valid, in the sense of
// credential provider extension should provide or ignore/delete credentials
// associated with this ID. Completes with YES if account is valid or
// NO with or without error if it is not.
- (void)isValidProviderAccountID:(NSString*)accountID
completionHandler:(void (^)(BOOL, NSError*))completionHandler;
- (void)validateValidationID:(NSString*)validationID
completionHandler:(void (^)(BOOL, NSError*))completionHandler;
@end
......
......@@ -10,9 +10,18 @@
@implementation AccountVerificationProvider
- (void)isValidProviderAccountID:(NSString*)accountID
completionHandler:(void (^)(BOOL, NSError*))completionHandler {
// Default implementation return always true.
- (void)validationIDForAccountID:(NSString*)accountID
completionHandler:
(void (^)(NSString*, NSError*))completionHandler {
// Default implementation always return nil.
dispatch_async(dispatch_get_main_queue(), ^{
completionHandler(nil, nil);
});
}
- (void)validateValidationID:(NSString*)validationID
completionHandler:(void (^)(BOOL, NSError*))completionHandler {
// Default implementation always return true.
dispatch_async(dispatch_get_main_queue(), ^{
completionHandler(YES, nil);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment