| 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_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Data is not validated; |pan|, |cvn| and |billing_address| must be set. | 45 // Data is not validated; |pan|, |cvn| and |billing_address| must be set. |
| 46 static scoped_ptr<FullWallet> | 46 static scoped_ptr<FullWallet> |
| 47 CreateFullWalletFromClearText(int expiration_month, | 47 CreateFullWalletFromClearText(int expiration_month, |
| 48 int expiration_year, | 48 int expiration_year, |
| 49 const std::string& pan, | 49 const std::string& pan, |
| 50 const std::string& cvn, | 50 const std::string& cvn, |
| 51 scoped_ptr<Address> billing_address, | 51 scoped_ptr<Address> billing_address, |
| 52 scoped_ptr<Address> shipping_address); | 52 scoped_ptr<Address> shipping_address); |
| 53 | 53 |
| 54 // Returns corresponding data for |type|. | 54 // Returns corresponding data for |type|. |
| 55 base::string16 GetInfo(const AutofillType& type); | 55 base::string16 GetInfo(const std::string& app_locale, |
| 56 const AutofillType& type); |
| 56 | 57 |
| 57 // Whether or not |action| is in |required_actions_|. | 58 // Whether or not |action| is in |required_actions_|. |
| 58 bool HasRequiredAction(RequiredAction action) const; | 59 bool HasRequiredAction(RequiredAction action) const; |
| 59 | 60 |
| 60 // The type of the card that this FullWallet contains and the last four digits | 61 // The type of the card that this FullWallet contains and the last four digits |
| 61 // like this "Visa - 4111". | 62 // like this "Visa - 4111". |
| 62 base::string16 TypeAndLastFourDigits(); | 63 base::string16 TypeAndLastFourDigits(); |
| 63 | 64 |
| 65 // Decrypts and returns the primary account number (PAN) using the generated |
| 66 // one time pad, |one_time_pad_|. |
| 67 const std::string& GetPan(); |
| 68 |
| 64 bool operator==(const FullWallet& other) const; | 69 bool operator==(const FullWallet& other) const; |
| 65 bool operator!=(const FullWallet& other) const; | 70 bool operator!=(const FullWallet& other) const; |
| 66 | 71 |
| 67 // If there are required actions |billing_address_| might contain NULL. | 72 // If there are required actions |billing_address_| might contain NULL. |
| 68 const Address* billing_address() const { return billing_address_.get(); } | 73 const Address* billing_address() const { return billing_address_.get(); } |
| 69 | 74 |
| 70 // If there are required actions or shipping address is not required | 75 // If there are required actions or shipping address is not required |
| 71 // |shipping_address_| might contain NULL. | 76 // |shipping_address_| might contain NULL. |
| 72 const Address* shipping_address() const { return shipping_address_.get(); } | 77 const Address* shipping_address() const { return shipping_address_.get(); } |
| 73 | 78 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 96 int expiration_year, | 101 int expiration_year, |
| 97 const std::string& iin, | 102 const std::string& iin, |
| 98 const std::string& encrypted_rest, | 103 const std::string& encrypted_rest, |
| 99 scoped_ptr<Address> billing_address, | 104 scoped_ptr<Address> billing_address, |
| 100 scoped_ptr<Address> shipping_address, | 105 scoped_ptr<Address> shipping_address, |
| 101 const std::vector<RequiredAction>& required_actions); | 106 const std::vector<RequiredAction>& required_actions); |
| 102 | 107 |
| 103 // Decrypts both |pan_| and |cvn_|. | 108 // Decrypts both |pan_| and |cvn_|. |
| 104 void DecryptCardInfo(); | 109 void DecryptCardInfo(); |
| 105 | 110 |
| 106 // Decrypts and returns the primary account number (PAN) using the generated | |
| 107 // one time pad, |one_time_pad_|. | |
| 108 const std::string& GetPan(); | |
| 109 | |
| 110 // Decrypts and returns the card verification number (CVN) using the generated | 111 // Decrypts and returns the card verification number (CVN) using the generated |
| 111 // one time pad, |one_time_pad_|. | 112 // one time pad, |one_time_pad_|. |
| 112 const std::string& GetCvn(); | 113 const std::string& GetCvn(); |
| 113 | 114 |
| 114 // The expiration month of the proxy card. It should be 1-12. | 115 // The expiration month of the proxy card. It should be 1-12. |
| 115 int expiration_month_; | 116 int expiration_month_; |
| 116 | 117 |
| 117 // The expiration year of the proxy card. It should be a 4-digit year. | 118 // The expiration year of the proxy card. It should be a 4-digit year. |
| 118 int expiration_year_; | 119 int expiration_year_; |
| 119 | 120 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 142 // The one time pad used for FullWallet encryption. | 143 // The one time pad used for FullWallet encryption. |
| 143 std::vector<uint8> one_time_pad_; | 144 std::vector<uint8> one_time_pad_; |
| 144 | 145 |
| 145 DISALLOW_COPY_AND_ASSIGN(FullWallet); | 146 DISALLOW_COPY_AND_ASSIGN(FullWallet); |
| 146 }; | 147 }; |
| 147 | 148 |
| 148 } // namespace wallet | 149 } // namespace wallet |
| 149 } // namespace autofill | 150 } // namespace autofill |
| 150 | 151 |
| 151 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ | 152 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ |
| OLD | NEW |