Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1092)

Side by Side Diff: components/autofill/browser/wallet/wallet_client.h

Issue 12893007: Implementing VERIFY_CVV required action. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ahutter@ review Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_H_ 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_H_
6 #define COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_H_ 6 #define COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 std::string google_transaction_id; 123 std::string google_transaction_id;
124 124
125 // The Risk challenges supported by the user of WalletClient 125 // The Risk challenges supported by the user of WalletClient
126 std::vector<RiskCapability> risk_capabilities; 126 std::vector<RiskCapability> risk_capabilities;
127 127
128 private: 128 private:
129 DISALLOW_ASSIGN(FullWalletRequest); 129 DISALLOW_ASSIGN(FullWalletRequest);
130 }; 130 };
131 131
132 // |context_getter| is reference counted so it has no lifetime or ownership 132 // |context_getter| is reference counted so it has no lifetime or ownership
133 // requirements. |observer| must outlive |this|. 133 // requirements. |delegate| must outlive |this|.
134 WalletClient(net::URLRequestContextGetter* context_getter, 134 WalletClient(net::URLRequestContextGetter* context_getter,
135 WalletClientDelegate* delegate); 135 WalletClientDelegate* delegate);
136 136
137 virtual ~WalletClient(); 137 virtual ~WalletClient();
138 138
139 // GetWalletItems retrieves the user's online wallet. The WalletItems 139 // GetWalletItems retrieves the user's online wallet. The WalletItems
140 // returned may require additional action such as presenting legal documents 140 // returned may require additional action such as presenting legal documents
141 // to the user to be accepted. |risk_capabilities| are the Risk challenges 141 // to the user to be accepted. |risk_capabilities| are the Risk challenges
142 // supported by the users of WalletClient. 142 // supported by the users of WalletClient.
143 void GetWalletItems(const GURL& source_url, 143 void GetWalletItems(const GURL& source_url,
144 const std::vector<RiskCapability>& risk_capabilities); 144 const std::vector<RiskCapability>& risk_capabilities);
145 145
146 // The GetWalletItems call to the Online Wallet backend may require the user 146 // The GetWalletItems call to the Online Wallet backend may require the user
147 // to accept various legal documents before a FullWallet can be generated. 147 // to accept various legal documents before a FullWallet can be generated.
148 // The |document_ids| and |google_transaction_id| are provided in the response 148 // The |document_ids| and |google_transaction_id| are provided in the response
149 // to the GetWalletItems call. 149 // to the GetWalletItems call.
150 virtual void AcceptLegalDocuments( 150 virtual void AcceptLegalDocuments(
151 const std::vector<std::string>& document_ids, 151 const std::vector<std::string>& document_ids,
152 const std::string& google_transaction_id, 152 const std::string& google_transaction_id,
153 const GURL& source_url); 153 const GURL& source_url);
154 154
155 // Authenticates that |card_verification_number| is for the backing instrument 155 // Authenticates that |card_verification_number| is for the backing instrument
156 // with |instrument_id|. |obfuscated_gaia_id| is used as a key when escrowing 156 // with |instrument_id|. |obfuscated_gaia_id| is used as a key when escrowing
157 // |card_verification_number|. |observer| is notified when the request is 157 // |card_verification_number|. |delegate_| is notified when the request is
158 // complete. Used to respond to Risk challenges. 158 // complete. Used to respond to Risk challenges.
159 void AuthenticateInstrument(const std::string& instrument_id, 159 virtual void AuthenticateInstrument(
160 const std::string& card_verification_number, 160 const std::string& instrument_id,
161 const std::string& obfuscated_gaia_id); 161 const std::string& card_verification_number,
162 const std::string& obfuscated_gaia_id);
162 163
163 // GetFullWallet retrieves the a FullWallet for the user. 164 // GetFullWallet retrieves the a FullWallet for the user.
164 virtual void GetFullWallet(const FullWalletRequest& full_wallet_request); 165 virtual void GetFullWallet(const FullWalletRequest& full_wallet_request);
165 166
166 // SaveAddress saves a new shipping address. 167 // SaveAddress saves a new shipping address.
167 virtual void SaveAddress(const Address& address, const GURL& source_url); 168 virtual void SaveAddress(const Address& address, const GURL& source_url);
168 169
169 // SaveInstrument saves a new instrument. 170 // SaveInstrument saves a new instrument.
170 virtual void SaveInstrument(const Instrument& instrument, 171 virtual void SaveInstrument(const Instrument& instrument,
171 const std::string& obfuscated_gaia_id, 172 const std::string& obfuscated_gaia_id,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 GET_FULL_WALLET, 216 GET_FULL_WALLET,
216 GET_WALLET_ITEMS, 217 GET_WALLET_ITEMS,
217 SAVE_ADDRESS, 218 SAVE_ADDRESS,
218 SAVE_INSTRUMENT, 219 SAVE_INSTRUMENT,
219 SAVE_INSTRUMENT_AND_ADDRESS, 220 SAVE_INSTRUMENT_AND_ADDRESS,
220 SEND_STATUS, 221 SEND_STATUS,
221 UPDATE_ADDRESS, 222 UPDATE_ADDRESS,
222 UPDATE_INSTRUMENT, 223 UPDATE_INSTRUMENT,
223 }; 224 };
224 225
225 // Posts |post_body| to |url| and notifies |observer| when the request is 226 // Posts |post_body| to |url| and notifies |delegate_| when the request is
226 // complete. 227 // complete.
227 void MakeWalletRequest(const GURL& url, const std::string& post_body); 228 void MakeWalletRequest(const GURL& url, const std::string& post_body);
228 229
229 // Performs bookkeeping tasks for any invalid requests. 230 // Performs bookkeeping tasks for any invalid requests.
230 void HandleMalformedResponse(); 231 void HandleMalformedResponse();
231 void HandleNetworkError(int response_code); 232 void HandleNetworkError(int response_code);
232 void HandleWalletError(ErrorType error_type); 233 void HandleWalletError(ErrorType error_type);
233 234
234 // Start the next pending request (if any). 235 // Start the next pending request (if any).
235 void StartNextPendingRequest(); 236 void StartNextPendingRequest();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 // Wallet. 284 // Wallet.
284 EncryptionEscrowClient encryption_escrow_client_; 285 EncryptionEscrowClient encryption_escrow_client_;
285 286
286 DISALLOW_COPY_AND_ASSIGN(WalletClient); 287 DISALLOW_COPY_AND_ASSIGN(WalletClient);
287 }; 288 };
288 289
289 } // namespace wallet 290 } // namespace wallet
290 } // namespace autofill 291 } // namespace autofill
291 292
292 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_H_ 293 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_WALLET_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698