forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WebViewTrustedVaultClient to //ios/web_view
This is a no op implementation for now. Bug: 1266130 Change-Id: If3f953ad724a674274afa5d90906a3401f487ca7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3257940 Commit-Queue: John Wu <jzw@chromium.org> Reviewed-by: Hiroshi Ichikawa <ichikawa@chromium.org> Cr-Commit-Position: refs/heads/main@{#938381}
- Loading branch information
John Wu
authored and
Chromium LUCI CQ
committed
Nov 4, 2021
1 parent
7f38849
commit 1c54d1a
Showing
5 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
ios/web_view/internal/sync/web_view_trusted_vault_client.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2021 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_WEB_VIEW_INTERNAL_SYNC_WEB_VIEW_TRUSTED_VAULT_CLIENT_H_ | ||
#define IOS_WEB_VIEW_INTERNAL_SYNC_WEB_VIEW_TRUSTED_VAULT_CLIENT_H_ | ||
|
||
#include "components/sync/driver/trusted_vault_client.h" | ||
|
||
namespace ios_web_view { | ||
|
||
// ChromeWebView implementation of TrustedVaultClient. | ||
// This class uses the Chrome trusted vault service to store the shared keys. | ||
class WebViewTrustedVaultClient : public syncer::TrustedVaultClient { | ||
public: | ||
explicit WebViewTrustedVaultClient(); | ||
~WebViewTrustedVaultClient() override; | ||
|
||
// TrustedVaultClient implementation. | ||
void AddObserver(Observer* observer) override; | ||
void RemoveObserver(Observer* observer) override; | ||
void FetchKeys( | ||
const CoreAccountInfo& account_info, | ||
base::OnceCallback<void(const std::vector<std::vector<uint8_t>>&)> | ||
callback) override; | ||
void StoreKeys(const std::string& gaia_id, | ||
const std::vector<std::vector<uint8_t>>& keys, | ||
int last_key_version) override; | ||
void MarkLocalKeysAsStale(const CoreAccountInfo& account_info, | ||
base::OnceCallback<void(bool)> callback) override; | ||
void GetIsRecoverabilityDegraded( | ||
const CoreAccountInfo& account_info, | ||
base::OnceCallback<void(bool)> callback) override; | ||
void AddTrustedRecoveryMethod(const std::string& gaia_id, | ||
const std::vector<uint8_t>& public_key, | ||
int method_type_hint, | ||
base::OnceClosure callback) override; | ||
|
||
// Not copyable or movable | ||
WebViewTrustedVaultClient(const WebViewTrustedVaultClient&) = delete; | ||
WebViewTrustedVaultClient& operator=(const WebViewTrustedVaultClient&) = | ||
delete; | ||
}; | ||
|
||
} // namespace ios_web_view | ||
|
||
#endif // IOS_WEB_VIEW_INTERNAL_SYNC_WEB_VIEW_TRUSTED_VAULT_CLIENT_H_ |
65 changes: 65 additions & 0 deletions
65
ios/web_view/internal/sync/web_view_trusted_vault_client.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright 2021 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. | ||
|
||
#include "ios/web_view/internal/sync/web_view_trusted_vault_client.h" | ||
|
||
#include "base/callback.h" | ||
#include "base/notreached.h" | ||
#include "components/signin/public/identity_manager/account_info.h" | ||
|
||
#if !defined(__has_feature) || !__has_feature(objc_arc) | ||
#error "This file requires ARC support." | ||
#endif | ||
|
||
namespace ios_web_view { | ||
|
||
WebViewTrustedVaultClient::WebViewTrustedVaultClient() {} | ||
|
||
WebViewTrustedVaultClient::~WebViewTrustedVaultClient() = default; | ||
|
||
void WebViewTrustedVaultClient::AddObserver(Observer* observer) { | ||
// TODO(crbug.com/1266130): Implement this. | ||
} | ||
|
||
void WebViewTrustedVaultClient::RemoveObserver(Observer* observer) { | ||
// TODO(crbug.com/1266130): Implement this. | ||
} | ||
|
||
void WebViewTrustedVaultClient::FetchKeys( | ||
const CoreAccountInfo& account_info, | ||
base::OnceCallback<void(const std::vector<std::vector<uint8_t>>&)> | ||
callback) { | ||
// TODO(crbug.com/1266130): Implement this. | ||
} | ||
|
||
void WebViewTrustedVaultClient::StoreKeys( | ||
const std::string& gaia_id, | ||
const std::vector<std::vector<uint8_t>>& keys, | ||
int last_key_version) { | ||
// Not used on iOS. | ||
NOTREACHED(); | ||
} | ||
|
||
void WebViewTrustedVaultClient::MarkLocalKeysAsStale( | ||
const CoreAccountInfo& account_info, | ||
base::OnceCallback<void(bool)> callback) { | ||
// TODO(crbug.com/1266130): Implement this. | ||
} | ||
|
||
void WebViewTrustedVaultClient::GetIsRecoverabilityDegraded( | ||
const CoreAccountInfo& account_info, | ||
base::OnceCallback<void(bool)> callback) { | ||
// TODO(crbug.com/1266130): Implement this. | ||
} | ||
|
||
void WebViewTrustedVaultClient::AddTrustedRecoveryMethod( | ||
const std::string& gaia_id, | ||
const std::vector<uint8_t>& public_key, | ||
int method_type_hint, | ||
base::OnceClosure callback) { | ||
// Not used on iOS. | ||
NOTREACHED(); | ||
} | ||
|
||
} // namespace ios_web_view |