summaryrefslogtreecommitdiffstats
path: root/components/autofill/content/browser/wallet/encryption_escrow_client_observer.h
diff options
context:
space:
mode:
Diffstat (limited to 'components/autofill/content/browser/wallet/encryption_escrow_client_observer.h')
-rw-r--r--components/autofill/content/browser/wallet/encryption_escrow_client_observer.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/components/autofill/content/browser/wallet/encryption_escrow_client_observer.h b/components/autofill/content/browser/wallet/encryption_escrow_client_observer.h
new file mode 100644
index 0000000..d5ff17d
--- /dev/null
+++ b/components/autofill/content/browser/wallet/encryption_escrow_client_observer.h
@@ -0,0 +1,53 @@
+// Copyright 2013 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 COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_ENCRYPTION_ESCROW_CLIENT_OBSERVER_H_
+#define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_ENCRYPTION_ESCROW_CLIENT_OBSERVER_H_
+
+#include <string>
+
+namespace autofill {
+namespace wallet {
+
+// EncryptionEscrowClientObserver is to be implemented by any classes making
+// calls with EncryptionEscrowClient. The appropriate callback method will be
+// called on EncryptionEscrowClientObserver with the response from the Online
+// Wallet encryption and escrow backend.
+class EncryptionEscrowClientObserver {
+ public:
+ // Called when an EncryptOneTimePad request finishes successfully.
+ // |encrypted_one_time_pad| and |session_material| must be used when getting a
+ // FullWallet.
+ virtual void OnDidEncryptOneTimePad(const std::string& encrypted_one_time_pad,
+ const std::string& session_material) = 0;
+
+ // Called when an EscrowCardVerificationNumber request finishes
+ // successfully. |escrow_handle| must be used when authenticating an
+ // instrument.
+ virtual void OnDidEscrowCardVerificationNumber(
+ const std::string& escrow_handle) = 0;
+
+ // Called when an EscrowInstrumentInformation request finishes successfully.
+ // |escrow_handle| must be used when saving a new instrument.
+ virtual void OnDidEscrowInstrumentInformation(
+ const std::string& escrow_handle) = 0;
+
+ // Called when a request is made to the encryption escrow server.
+ virtual void OnDidMakeRequest() = 0;
+
+ // Called when a request fails due to a network error or if the response was
+ // invalid.
+ virtual void OnNetworkError(int response_code) = 0;
+
+ // Called when a request fails due to a malformed response.
+ virtual void OnMalformedResponse() = 0;
+
+ protected:
+ virtual ~EncryptionEscrowClientObserver() {}
+};
+
+} // namespace wallet
+} // namespace autofill
+
+#endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_ENCRYPTION_ESCROW_CLIENT_OBSERVER_H_