Chromium Code Reviews| Index: chrome/browser/autofill/wallet/full_wallet.h |
| diff --git a/chrome/browser/autofill/wallet/full_wallet.h b/chrome/browser/autofill/wallet/full_wallet.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7d698f03eb7e9198f0cc7de16588465d36d2aa90 |
| --- /dev/null |
| +++ b/chrome/browser/autofill/wallet/full_wallet.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright (c) 2012 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 CHROME_BROWSER_AUTOFILL_WALLET_FULL_WALLET_H_ |
| +#define CHROME_BROWSER_AUTOFILL_WALLET_FULL_WALLET_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/autofill/wallet/wallet_address.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} |
| + |
| +namespace wallet { |
| + |
| +class FullWallet { |
| + public: |
| + FullWallet(int expiration_month, |
| + int expiration_year, |
| + const std::string& iin, |
| + const std::string& encrypted_rest, |
| + Address* billing_address, |
| + Address* shipping_address, |
| + const std::vector<std::string> required_actions); |
| + ~FullWallet(); |
|
Dan Beam
2012/11/30 19:55:52
nit: \n before each method with a description
ahutter
2012/12/01 04:06:51
Done.
|
| + // Returns null if the input invalid, an empty wallet with required actions if |
| + // there are any, or a valid wallet. The caller owns the returned pointer. |
| + static FullWallet* CreateFullWallet(base::DictionaryValue* dictionary); |
| + // Decrypts and returns primary account number (PAN) using generated one time |
| + // pad (OTP) |
|
Dan Beam
2012/11/30 19:55:52
nit: finish comments (even if sentence fragments,
ahutter
2012/12/01 04:06:51
Done.
|
| + const std::string GetPAN(void* bytes, size_t length); |
| + // Decrypts and returns card verification number (CVN) using generated one |
| + // time pad (OTP) |
| + const std::string GetCVN(void* bytes, size_t length); |
| + bool operator==(const FullWallet& other) const; |
| + bool operator!=(const FullWallet& other) const; |
| + |
| + const Address* get_billing_address() const { return billing_address_.get(); } |
| + const Address* get_shipping_address() const { |
| + return shipping_address_.get(); |
| + } |
| + const std::vector<std::string> get_required_actions() const { |
| + return required_actions_; |
| + } |
| + int get_expiration_month() const { return expiration_month_; } |
| + int get_expiration_year() const { return expiration_year_; } |
| + |
| + private: |
| + void DecryptCardInfo(uint8* otp, size_t length); |
| + int expiration_month_; |
|
Dan Beam
2012/11/30 19:55:52
I assume the compiler will optimize this for us (a
ahutter
2012/12/01 04:06:51
Not sure. +abodenha?
|
| + int expiration_year_; |
| + std::string pan_; |
| + std::string cvn_; |
| + std::string iin_; |
| + std::string encrypted_rest_; |
|
Dan Beam
2012/11/30 19:55:52
if I were just looking at this file, I'd have no g
ahutter
2012/12/01 04:06:51
Done.
|
| + scoped_ptr<Address> billing_address_; |
| + scoped_ptr<Address> shipping_address_; |
| + std::vector<std::string> required_actions_; |
| + DISALLOW_COPY_AND_ASSIGN(FullWallet); |
| +}; |
| + |
| +} // end namespace wallet |
| + |
| +#endif // CHROME_BROWSER_AUTOFILL_WALLET_FULL_WALLET_H_ |