Commit ea27b4ba authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Adding abstract class for ChromeTrustedVaultService.

ChromeTrustedVaultService is an abstract class to support the trusted
vault on iOS. Also this patch adds
ChromeBrowserProvider::GetChromeTrustedValueService().
This method needs to be overridden by ChromeBrowserProviderImpl

Related:
=> crrev.com/c/2111302 ChromeTrustedVaultService
 - crrev.com/i/2774364 ChromeTrustedVaultServiceImpl
 - crrev.com/c/2118054 IOSTrustedVaultClient

Bug: 1019685
Change-Id: Ia6a4384a9e74655427f435f09a9871d104953309
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2116079
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754032}
parent 29194918
......@@ -47,6 +47,7 @@ namespace ios {
class ChromeBrowserProvider;
class ChromeIdentityService;
class ChromeTrustedVaultService;
class GeolocationUpdaterProvider;
class SigninErrorProvider;
class SigninResourcesProvider;
......@@ -104,6 +105,8 @@ class ChromeBrowserProvider {
std::unique_ptr<ChromeIdentityService> service);
// Returns an instance of a Chrome identity service.
virtual ChromeIdentityService* GetChromeIdentityService();
// Returns an instance of a Chrome trusted vault service.
virtual ChromeTrustedVaultService* GetChromeTrustedVaultService();
// Returns an instance of a GeolocationUpdaterProvider.
virtual GeolocationUpdaterProvider* GetGeolocationUpdaterProvider();
// Returns risk data used in Wallet requests.
......
......@@ -59,6 +59,11 @@ ChromeIdentityService* ChromeBrowserProvider::GetChromeIdentityService() {
return nullptr;
}
ChromeTrustedVaultService*
ChromeBrowserProvider::GetChromeTrustedVaultService() {
return nullptr;
}
GeolocationUpdaterProvider*
ChromeBrowserProvider::GetGeolocationUpdaterProvider() {
return nullptr;
......
......@@ -12,6 +12,8 @@ source_set("signin") {
"chrome_identity_interaction_manager.mm",
"chrome_identity_service.h",
"chrome_identity_service.mm",
"chrome_trusted_vault_service.h",
"chrome_trusted_vault_service.mm",
"signin_error_provider.h",
"signin_error_provider.mm",
"signin_resources_provider.h",
......
// 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_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_CHROME_TRUSTED_VAULT_SERVICE_H_
#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_CHROME_TRUSTED_VAULT_SERVICE_H_
#include <vector>
#include "base/callback.h"
#include "base/macros.h"
@class ChromeIdentity;
namespace ios {
using TrustedVaultSharedKey = std::vector<uint8_t>;
using TrustedVaultSharedKeyList = std::vector<TrustedVaultSharedKey>;
// Abstract class to manage shared keys.
class ChromeTrustedVaultService {
public:
ChromeTrustedVaultService();
virtual ~ChromeTrustedVaultService();
// Asynchronously fetch the shared keys for |identity|
// and returns them by calling |callback|.
virtual void FetchKeys(
ChromeIdentity* chrome_identity,
base::OnceCallback<void(const TrustedVaultSharedKeyList&)> callback);
private:
DISALLOW_COPY_AND_ASSIGN(ChromeTrustedVaultService);
};
} // namespace ios
#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_CHROME_TRUSTED_VAULT_SERVICE_H_
// 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.
#import "ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.h"
#import "base/logging.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace ios {
ChromeTrustedVaultService::ChromeTrustedVaultService() {}
ChromeTrustedVaultService::~ChromeTrustedVaultService() {}
void ChromeTrustedVaultService::FetchKeys(
ChromeIdentity* chrome_identity,
base::OnceCallback<void(const TrustedVaultSharedKeyList&)> callback) {
NOTREACHED();
}
} // namespace ios
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