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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "components/autofill/content/browser/wallet/required_action.h" | 15 #include "components/autofill/content/browser/wallet/required_action.h" |
16 #include "components/autofill/content/browser/wallet/wallet_address.h" | 16 #include "components/autofill/content/browser/wallet/wallet_address.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class DictionaryValue; | 19 class DictionaryValue; |
20 } | 20 } |
21 | 21 |
22 namespace autofill { | 22 namespace autofill { |
| 23 |
| 24 class AutofillType; |
| 25 |
23 namespace wallet { | 26 namespace wallet { |
24 | 27 |
25 class FullWalletTest; | 28 class FullWalletTest; |
26 | 29 |
27 // FullWallet contains all the information a merchant requires from a user for | 30 // FullWallet contains all the information a merchant requires from a user for |
28 // that user to make a purchase. This includes: | 31 // that user to make a purchase. This includes: |
29 // - billing information | 32 // - billing information |
30 // - shipping information | 33 // - shipping information |
31 // - a proxy card for the backing card selected from a user's wallet items | 34 // - a proxy card for the backing card selected from a user's wallet items |
32 class FullWallet { | 35 class FullWallet { |
33 public: | 36 public: |
34 ~FullWallet(); | 37 ~FullWallet(); |
35 | 38 |
36 // Returns an empty scoped_ptr if the input invalid, an empty wallet with | 39 // Returns an empty scoped_ptr if the input invalid, an empty wallet with |
37 // required actions if there are any, or a valid wallet. | 40 // required actions if there are any, or a valid wallet. |
38 static scoped_ptr<FullWallet> | 41 static scoped_ptr<FullWallet> |
39 CreateFullWallet(const base::DictionaryValue& dictionary); | 42 CreateFullWallet(const base::DictionaryValue& dictionary); |
40 | 43 |
41 // Returns corresponding data for |type|. | 44 // Returns corresponding data for |type|. |
42 base::string16 GetInfo(AutofillFieldType type); | 45 base::string16 GetInfo(const AutofillType& type); |
43 | 46 |
44 // Whether or not |action| is in |required_actions_|. | 47 // Whether or not |action| is in |required_actions_|. |
45 bool HasRequiredAction(RequiredAction action) const; | 48 bool HasRequiredAction(RequiredAction action) const; |
46 | 49 |
47 // The type of the card that this FullWallet contains and the last four digits | 50 // The type of the card that this FullWallet contains and the last four digits |
48 // like this "Visa - 4111". | 51 // like this "Visa - 4111". |
49 base::string16 TypeAndLastFourDigits(); | 52 base::string16 TypeAndLastFourDigits(); |
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; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // The one time pad used for FullWallet encryption. | 130 // The one time pad used for FullWallet encryption. |
128 std::vector<uint8> one_time_pad_; | 131 std::vector<uint8> one_time_pad_; |
129 | 132 |
130 DISALLOW_COPY_AND_ASSIGN(FullWallet); | 133 DISALLOW_COPY_AND_ASSIGN(FullWallet); |
131 }; | 134 }; |
132 | 135 |
133 } // namespace wallet | 136 } // namespace wallet |
134 } // namespace autofill | 137 } // namespace autofill |
135 | 138 |
136 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ | 139 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_FULL_WALLET_H_ |
OLD | NEW |