Chromium Code Reviews| 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 GetBillingInfo(const std::string& app_locale, |
| 56 const AutofillType& type); | |
| 57 base::string16 GetShippingInfo(const std::string& app_locale, | |
| 58 const AutofillType& type); | |
| 56 | 59 |
| 57 // Whether or not |action| is in |required_actions_|. | 60 // Whether or not |action| is in |required_actions_|. |
| 58 bool HasRequiredAction(RequiredAction action) const; | 61 bool HasRequiredAction(RequiredAction action) const; |
| 59 | 62 |
| 60 // The type of the card that this FullWallet contains and the last four digits | 63 // The type of the card that this FullWallet contains and the last four digits |
| 61 // like this "Visa - 4111". | 64 // like this "Visa - 4111". |
| 62 base::string16 TypeAndLastFourDigits(); | 65 base::string16 TypeAndLastFourDigits(); |
| 63 | 66 |
| 67 // Decrypts and returns the primary account number (PAN) using the generated | |
| 68 // one time pad, |one_time_pad_|. | |
| 69 const std::string& GetPan(); | |
| 70 | |
| 64 bool operator==(const FullWallet& other) const; | 71 bool operator==(const FullWallet& other) const; |
| 65 bool operator!=(const FullWallet& other) const; | 72 bool operator!=(const FullWallet& other) const; |
| 66 | 73 |
| 67 // If there are required actions |billing_address_| might contain NULL. | 74 // If there are required actions |billing_address_| might contain NULL. |
| 68 const Address* billing_address() const { return billing_address_.get(); } | 75 const Address* billing_address() const { return billing_address_.get(); } |
| 69 | 76 |
| 70 // If there are required actions or shipping address is not required | 77 // If there are required actions or shipping address is not required |
| 71 // |shipping_address_| might contain NULL. | 78 // |shipping_address_| might contain NULL. |
| 72 const Address* shipping_address() const { return shipping_address_.get(); } | 79 const Address* shipping_address() const { return shipping_address_.get(); } |
| 73 | 80 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 96 int expiration_year, | 103 int expiration_year, |
| 97 const std::string& iin, | 104 const std::string& iin, |
| 98 const std::string& encrypted_rest, | 105 const std::string& encrypted_rest, |
| 99 scoped_ptr<Address> billing_address, | 106 scoped_ptr<Address> billing_address, |
| 100 scoped_ptr<Address> shipping_address, | 107 scoped_ptr<Address> shipping_address, |
| 101 const std::vector<RequiredAction>& required_actions); | 108 const std::vector<RequiredAction>& required_actions); |
| 102 | 109 |
| 103 // Decrypts both |pan_| and |cvn_|. | 110 // Decrypts both |pan_| and |cvn_|. |
| 104 void DecryptCardInfo(); | 111 void DecryptCardInfo(); |
| 105 | 112 |
| 106 // Decrypts and returns the primary account number (PAN) using the generated | |
| 107 // one time pad, |one_time_pad_|. | |
| 108 const std::string& GetPan(); | |
|
Dan Beam
2014/01/27 19:37:50
^ why is revealing this method preferable?
Evan Stade
2014/01/27 19:45:41
Why not expose it? It makes the code slightly shor
Dan Beam
2014/01/27 20:18:23
2 ways of doing the same thing.
Evan Stade
2014/01/27 20:28:24
which each have their own purpose. One is easier t
| |
| 109 | |
| 110 // Decrypts and returns the card verification number (CVN) using the generated | 113 // Decrypts and returns the card verification number (CVN) using the generated |
| 111 // one time pad, |one_time_pad_|. | 114 // one time pad, |one_time_pad_|. |
| 112 const std::string& GetCvn(); | 115 const std::string& GetCvn(); |
| 113 | 116 |
| 114 // The expiration month of the proxy card. It should be 1-12. | 117 // The expiration month of the proxy card. It should be 1-12. |
| 115 int expiration_month_; | 118 int expiration_month_; |
| 116 | 119 |
| 117 // The expiration year of the proxy card. It should be a 4-digit year. | 120 // The expiration year of the proxy card. It should be a 4-digit year. |
| 118 int expiration_year_; | 121 int expiration_year_; |
| 119 | 122 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 142 // The one time pad used for FullWallet encryption. | 145 // The one time pad used for FullWallet encryption. |
| 143 std::vector<uint8> one_time_pad_; | 146 std::vector<uint8> one_time_pad_; |
| 144 | 147 |
| 145 DISALLOW_COPY_AND_ASSIGN(FullWallet); | 148 DISALLOW_COPY_AND_ASSIGN(FullWallet); |
| 146 }; | 149 }; |
| 147 | 150 |
| 148 } // namespace wallet | 151 } // namespace wallet |
| 149 } // namespace autofill | 152 } // namespace autofill |
| 150 | 153 |
| 151 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ | 154 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ |
| OLD | NEW |