OLD | NEW |
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_FULL_WALLET_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ |
6 #define COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 CreateFullWallet(const base::DictionaryValue& dictionary); | 38 CreateFullWallet(const base::DictionaryValue& dictionary); |
39 | 39 |
40 // Decrypts and returns the primary account number (PAN) using the generated | 40 // Decrypts and returns the primary account number (PAN) using the generated |
41 // one time pad, |one_time_pad_|. | 41 // one time pad, |one_time_pad_|. |
42 const std::string& GetPan(); | 42 const std::string& GetPan(); |
43 | 43 |
44 // Decrypts and returns the card verification number (CVN) using the generated | 44 // Decrypts and returns the card verification number (CVN) using the generated |
45 // one time pad, |one_time_pad_|. | 45 // one time pad, |one_time_pad_|. |
46 const std::string& GetCvn(); | 46 const std::string& GetCvn(); |
47 | 47 |
| 48 // Returns corresponding data for |type|. |
| 49 string16 GetInfo(AutofillFieldType type, bool is_shipping); |
| 50 |
48 // Whether or not |action| is in |required_actions_|. | 51 // Whether or not |action| is in |required_actions_|. |
49 bool HasRequiredAction(RequiredAction action) const; | 52 bool HasRequiredAction(RequiredAction action) const; |
50 | 53 |
51 bool operator==(const FullWallet& other) const; | 54 bool operator==(const FullWallet& other) const; |
52 bool operator!=(const FullWallet& other) const; | 55 bool operator!=(const FullWallet& other) const; |
53 | 56 |
54 // If there are required actions |billing_address_| might contain NULL. | 57 // If there are required actions |billing_address_| might contain NULL. |
55 const Address* billing_address() const { return billing_address_.get(); } | 58 const Address* billing_address() const { return billing_address_.get(); } |
56 | 59 |
57 // If there are required actions or shipping address is not required | 60 // If there are required actions or shipping address is not required |
(...skipping 14 matching lines...) Expand all Loading... |
72 friend class FullWalletTest; | 75 friend class FullWalletTest; |
73 FRIEND_TEST_ALL_PREFIXES(FullWalletTest, CreateFullWallet); | 76 FRIEND_TEST_ALL_PREFIXES(FullWalletTest, CreateFullWallet); |
74 FRIEND_TEST_ALL_PREFIXES(FullWalletTest, CreateFullWalletWithRequiredActions); | 77 FRIEND_TEST_ALL_PREFIXES(FullWalletTest, CreateFullWalletWithRequiredActions); |
75 FullWallet(int expiration_month, | 78 FullWallet(int expiration_month, |
76 int expiration_year, | 79 int expiration_year, |
77 const std::string& iin, | 80 const std::string& iin, |
78 const std::string& encrypted_rest, | 81 const std::string& encrypted_rest, |
79 scoped_ptr<Address> billing_address, | 82 scoped_ptr<Address> billing_address, |
80 scoped_ptr<Address> shipping_address, | 83 scoped_ptr<Address> shipping_address, |
81 const std::vector<RequiredAction>& required_actions); | 84 const std::vector<RequiredAction>& required_actions); |
| 85 |
| 86 // Decrypts both |pan_| and |cvn_|. |
82 void DecryptCardInfo(); | 87 void DecryptCardInfo(); |
83 | 88 |
| 89 // Returns either the billing or shipping address based on |is_billing|. |
| 90 const Address* GetAddress(bool is_billing) const; |
| 91 |
84 // The expiration month of the proxy card. It should be 1-12. | 92 // The expiration month of the proxy card. It should be 1-12. |
85 int expiration_month_; | 93 int expiration_month_; |
86 | 94 |
87 // The expiration year of the proxy card. It should be a 4-digit year. | 95 // The expiration year of the proxy card. It should be a 4-digit year. |
88 int expiration_year_; | 96 int expiration_year_; |
89 | 97 |
90 // Primary account number (PAN). Its format is \d{16}. | 98 // Primary account number (PAN). Its format is \d{16}. |
91 std::string pan_; | 99 std::string pan_; |
92 | 100 |
93 // Card verification number (CVN). Its format is \d{3}. | 101 // Card verification number (CVN). Its format is \d{3}. |
(...skipping 18 matching lines...) Expand all Loading... |
112 // The one time pad used for FullWallet encryption. | 120 // The one time pad used for FullWallet encryption. |
113 std::vector<uint8> one_time_pad_; | 121 std::vector<uint8> one_time_pad_; |
114 | 122 |
115 DISALLOW_COPY_AND_ASSIGN(FullWallet); | 123 DISALLOW_COPY_AND_ASSIGN(FullWallet); |
116 }; | 124 }; |
117 | 125 |
118 } // namespace wallet | 126 } // namespace wallet |
119 } // namespace autofill | 127 } // namespace autofill |
120 | 128 |
121 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ | 129 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ |
OLD | NEW |