Commit dd6de687 authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

Reland "[iOS][Credential-Provider] Move account validator to common 1/3"

This is a reland of b5244048

The conflicting import has been removed.

Original change's description:
> [iOS][Credential-Provider] Move account validator to common 1/3
>
> Moves files to common to be used in Chrome.
>
> Bug: 1066803
> Change-Id: I6f3ec5e7916a94cdf37d20be3138e8e99ebb2257
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157215
> Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
> Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
> Reviewed-by: David Jean <djean@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#761452}

Bug: 1066803
Change-Id: Ie8658dfbc3323708330844e82e12b5fe0c42606c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2161033Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarDavid Jean <djean@chromium.org>
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761979}
parent 986ed6e9
......@@ -19,8 +19,7 @@ declare_args() {
# Label of the target providing implementation for AccountVerificationProvider.
# Overridden when using the Google-internal repository to build Chrome on iOS.
ios_account_verification_provider_target =
"//ios/chrome/credential_provider_extension:account_verification_provider"
ios_account_verification_provider_target = "//ios/chrome/common/credential_provider:account_verification_provider_implementation"
# Enable multi-window configuration in Info.plist
ios_enable_multi_window = false
......
......@@ -4,6 +4,7 @@
import("//build/buildflag_header.gni")
import("//build/config/ios/ios_sdk.gni")
import("//ios/build/chrome_build.gni")
source_set("credential_provider") {
configs += [ "//build/config/compiler:enable_arc" ]
......@@ -32,6 +33,29 @@ source_set("ui") {
libs = [ "Foundation.framework" ]
}
source_set("account_verification_provider") {
public_deps = [ ":account_verification_provider_header" ]
deps = [ ios_account_verification_provider_target ]
assert_no_deps = [ "//ios/chrome/browser/*" ]
configs += [ "//build/config/compiler:enable_arc" ]
libs = [ "Foundation.framework" ]
}
source_set("account_verification_provider_header") {
sources = [ "account_verification_provider.h" ]
assert_no_deps = [ "//ios/chrome/browser/*" ]
configs += [ "//build/config/compiler:enable_arc" ]
libs = [ "Foundation.framework" ]
}
source_set("account_verification_provider_implementation") {
sources = [ "account_verification_provider.mm" ]
deps = [ ":account_verification_provider_header" ]
assert_no_deps = [ "//ios/chrome/browser/*" ]
configs += [ "//build/config/compiler:enable_arc" ]
libs = [ "Foundation.framework" ]
}
source_set("unit_tests") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
......
// Copyright 2020 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.
#ifndef IOS_CHROME_COMMON_CREDENTIAL_PROVIDER_ACCOUNT_VERIFICATION_PROVIDER_H_
#define IOS_CHROME_COMMON_CREDENTIAL_PROVIDER_ACCOUNT_VERIFICATION_PROVIDER_H_
#import <Foundation/Foundation.h>
// Provider for account verification. New methods should be added to protocol
// as @optional, until implemented in all replacement providers.
@protocol AccountVerificationProvider
// 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)validateValidationID:(NSString*)validationID
completionHandler:(void (^)(BOOL, NSError*))completionHandler;
@end
// Provider for account verification.
@interface AccountVerificationProvider : NSObject <AccountVerificationProvider>
@end
#endif // IOS_CHROME_COMMON_CREDENTIAL_PROVIDER_ACCOUNT_VERIFICATION_PROVIDER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/credential_provider_extension/account_verification_provider.h"
#import "ios/chrome/common/credential_provider/account_verification_provider.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......
......@@ -91,24 +91,11 @@ generate_localizable_strings("system_strings") {
deps = [ _packed_resources_target ]
}
# Compatibility target. To be removed after internal is updated.
source_set("credential_provider_extension_providers") {
sources = [ "account_verification_provider.h" ]
assert_no_deps = [ "//ios/chrome/browser" ]
configs += [ "//build/config/compiler:enable_arc" ]
}
source_set("account_verification_provider") {
sources = [ "account_verification_provider.mm" ]
deps = [
":credential_provider_extension_providers",
"//base",
]
deps = [ "//ios/chrome/common/credential_provider:account_verification_provider_header" ]
assert_no_deps = [ "//ios/chrome/browser" ]
configs += [ "//build/config/compiler:enable_arc" ]
}
......
// Copyright 2020 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.
#ifndef IOS_CHROME_CREDENTIAL_PROVIDER_EXTENSION_ACCOUNT_VERIFICATION_PROVIDER_H_
#define IOS_CHROME_CREDENTIAL_PROVIDER_EXTENSION_ACCOUNT_VERIFICATION_PROVIDER_H_
#import <Foundation/Foundation.h>
// Provider for account verification. New methods should be added to protocol
// as @optional, until implemented in all replacement providers.
@protocol AccountVerificationProvider
// 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)validateValidationID:(NSString*)validationID
completionHandler:(void (^)(BOOL, NSError*))completionHandler;
@end
// Provider for account verification.
@interface AccountVerificationProvider : NSObject <AccountVerificationProvider>
@end
#endif // IOS_CHROME_CREDENTIAL_PROVIDER_EXTENSION_ACCOUNT_VERIFICATION_PROVIDER_H_
// Compatibility file. To be removed after internal is updated.
#import "ios/chrome/common/credential_provider/account_verification_provider.h"
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