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 21 matching lines...) Expand all Loading... | |
32 public: | 32 public: |
33 ~FullWallet(); | 33 ~FullWallet(); |
34 | 34 |
35 // Returns an empty scoped_ptr if the input invalid, an empty wallet with | 35 // Returns an empty scoped_ptr if the input invalid, an empty wallet with |
36 // required actions if there are any, or a valid wallet. | 36 // required actions if there are any, or a valid wallet. |
37 static scoped_ptr<FullWallet> | 37 static scoped_ptr<FullWallet> |
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(); |
Evan Stade
2013/03/14 18:15:47
since you're adding GetInfo, I don't think GetPan
Dan Beam
2013/03/14 18:36:43
Done.
| |
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); | |
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 |
84 // The expiration month of the proxy card. It should be 1-12. | 89 // The expiration month of the proxy card. It should be 1-12. |
85 int expiration_month_; | 90 int expiration_month_; |
86 | 91 |
87 // The expiration year of the proxy card. It should be a 4-digit year. | 92 // The expiration year of the proxy card. It should be a 4-digit year. |
88 int expiration_year_; | 93 int expiration_year_; |
89 | 94 |
90 // Primary account number (PAN). Its format is \d{16}. | 95 // Primary account number (PAN). Its format is \d{16}. |
91 std::string pan_; | 96 std::string pan_; |
(...skipping 20 matching lines...) Expand all Loading... | |
112 // The one time pad used for FullWallet encryption. | 117 // The one time pad used for FullWallet encryption. |
113 std::vector<uint8> one_time_pad_; | 118 std::vector<uint8> one_time_pad_; |
114 | 119 |
115 DISALLOW_COPY_AND_ASSIGN(FullWallet); | 120 DISALLOW_COPY_AND_ASSIGN(FullWallet); |
116 }; | 121 }; |
117 | 122 |
118 } // namespace wallet | 123 } // namespace wallet |
119 } // namespace autofill | 124 } // namespace autofill |
120 | 125 |
121 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ | 126 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ |
OLD | NEW |