| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_OBSERVER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_OBSERVER_H_ |
| 6 #define COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_OBSERVER_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 virtual void OnDidAuthenticateInstrument(bool success) = 0; | 50 virtual void OnDidAuthenticateInstrument(bool success) = 0; |
| 51 | 51 |
| 52 // Called when a GetFullWallet request finishes successfully. Ownership is | 52 // Called when a GetFullWallet request finishes successfully. Ownership is |
| 53 // transferred to implementer of this interface. | 53 // transferred to implementer of this interface. |
| 54 virtual void OnDidGetFullWallet(scoped_ptr<FullWallet> full_wallet) = 0; | 54 virtual void OnDidGetFullWallet(scoped_ptr<FullWallet> full_wallet) = 0; |
| 55 | 55 |
| 56 // Called when a GetWalletItems request finishes successfully. Ownership is | 56 // Called when a GetWalletItems request finishes successfully. Ownership is |
| 57 // transferred to implementer of this interface. | 57 // transferred to implementer of this interface. |
| 58 virtual void OnDidGetWalletItems(scoped_ptr<WalletItems> wallet_items) = 0; | 58 virtual void OnDidGetWalletItems(scoped_ptr<WalletItems> wallet_items) = 0; |
| 59 | 59 |
| 60 // Called when a SaveAddress request finishes successfully. |address_id| can | 60 // Called when a SaveToWallet request finishes succesfully. |
| 61 // be used in subsequent GetFullWallet calls. |required_actions| is populated | |
| 62 // if there was a validation error with the data being saved. | |
| 63 // |form_field_errors| is populated with the actual form fields that are | |
| 64 // failing validation. | |
| 65 virtual void OnDidSaveAddress( | |
| 66 const std::string& address_id, | |
| 67 const std::vector<RequiredAction>& required_actions, | |
| 68 const std::vector<FormFieldError>& form_field_errors) = 0; | |
| 69 | |
| 70 // Called when a SaveInstrument request finishes sucessfully. |instrument_id| | |
| 71 // can be used in subsequent GetFullWallet calls. |required_actions| is | |
| 72 // populated if there was a validation error with the data being saved. | |
| 73 // |form_field_errors| is populated with the actual form fields that are | |
| 74 // failing validation. | |
| 75 virtual void OnDidSaveInstrument( | |
| 76 const std::string& instrument_id, | |
| 77 const std::vector<RequiredAction>& required_actions, | |
| 78 const std::vector<FormFieldError>& form_field_errors) = 0; | |
| 79 | |
| 80 // Called when a SaveInstrumentAndAddress request finishes succesfully. | |
| 81 // |instrument_id| and |address_id| can be used in subsequent | 61 // |instrument_id| and |address_id| can be used in subsequent |
| 82 // GetFullWallet calls. |required_actions| is populated if there was a | 62 // GetFullWallet calls. |required_actions| is populated if there was a |
| 83 // validation error with the data being saved. |form_field_errors| is | 63 // validation error with the data being saved. |form_field_errors| is |
| 84 // populated with the actual form fields that are failing validation. | 64 // populated with the actual form fields that are failing validation. |
| 85 virtual void OnDidSaveInstrumentAndAddress( | 65 virtual void OnDidSaveToWallet( |
| 86 const std::string& instrument_id, | 66 const std::string& instrument_id, |
| 87 const std::string& address_id, | 67 const std::string& address_id, |
| 88 const std::vector<RequiredAction>& required_actions, | 68 const std::vector<RequiredAction>& required_actions, |
| 89 const std::vector<FormFieldError>& form_field_errors) = 0; | 69 const std::vector<FormFieldError>& form_field_errors) = 0; |
| 90 | 70 |
| 91 // Called when an UpdateAddress request finishes successfully. | |
| 92 // |required_actions| is populated if there was a validation error with the | |
| 93 // data being saved. |form_field_errors| is populated with the actual form | |
| 94 // fields that are failing validation. | |
| 95 virtual void OnDidUpdateAddress( | |
| 96 const std::string& address_id, | |
| 97 const std::vector<RequiredAction>& required_actions, | |
| 98 const std::vector<FormFieldError>& form_field_errors) = 0; | |
| 99 | |
| 100 // Called when an UpdateInstrument request finishes successfully. | |
| 101 // |required_actions| is populated if there was a validation error with the | |
| 102 // data being saved. |form_field_errors| is populated with the actual form | |
| 103 // fields that are failing validation. | |
| 104 virtual void OnDidUpdateInstrument( | |
| 105 const std::string& instrument_id, | |
| 106 const std::vector<RequiredAction>& required_actions, | |
| 107 const std::vector<FormFieldError>& form_field_errors) = 0; | |
| 108 | |
| 109 // Called when a request fails. | 71 // Called when a request fails. |
| 110 virtual void OnWalletError(WalletClient::ErrorType error_type) = 0; | 72 virtual void OnWalletError(WalletClient::ErrorType error_type) = 0; |
| 111 | 73 |
| 112 protected: | 74 protected: |
| 113 virtual ~WalletClientDelegate() {} | 75 virtual ~WalletClientDelegate() {} |
| 114 }; | 76 }; |
| 115 | 77 |
| 116 } // namespace wallet | 78 } // namespace wallet |
| 117 } // namespace autofill | 79 } // namespace autofill |
| 118 | 80 |
| 119 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_OBSERVER_H_ | 81 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_OBSERVER_H_ |
| OLD | NEW |