OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // The parameters should outlive the FullCardRequest. | 37 // The parameters should outlive the FullCardRequest. |
38 FullCardRequest(AutofillClient* autofill_client, | 38 FullCardRequest(AutofillClient* autofill_client, |
39 payments::PaymentsClient* payments_client, | 39 payments::PaymentsClient* payments_client, |
40 PersonalDataManager* personal_data_manager); | 40 PersonalDataManager* personal_data_manager); |
41 ~FullCardRequest(); | 41 ~FullCardRequest(); |
42 | 42 |
43 // Retrieves the pan and cvc for |card| and invokes | 43 // Retrieves the pan and cvc for |card| and invokes |
44 // Delegate::OnFullCardDetails() or Delegate::OnFullCardError(). Only one | 44 // Delegate::OnFullCardDetails() or Delegate::OnFullCardError(). Only one |
45 // request should be active at a time. | 45 // request should be active at a time. |
46 // | |
47 // If the card is local, has a non-empty GUID, and the user has updated its | |
48 // expiration date, then this function will write the new information to | |
49 // autofill table on disk. | |
50 void GetFullCard(const CreditCard& card, | 46 void GetFullCard(const CreditCard& card, |
51 AutofillClient::UnmaskCardReason reason, | 47 AutofillClient::UnmaskCardReason reason, |
52 base::WeakPtr<Delegate> delegate); | 48 base::WeakPtr<Delegate> delegate); |
53 | 49 |
54 // Returns true if there's a pending request to get the full card. | 50 // Returns true if there's a pending request to get the full card. |
55 bool IsGettingFullCard() const; | 51 bool IsGettingFullCard() const; |
56 | 52 |
57 // Called by the payments client when a card has been unmasked. | 53 // Called by the payments client when a card has been unmasked. |
58 void OnDidGetRealPan(AutofillClient::PaymentsRpcResult result, | 54 void OnDidGetRealPan(AutofillClient::PaymentsRpcResult result, |
59 const std::string& real_pan); | 55 const std::string& real_pan); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // communication is pending. | 91 // communication is pending. |
96 base::WeakPtrFactory<FullCardRequest> weak_ptr_factory_; | 92 base::WeakPtrFactory<FullCardRequest> weak_ptr_factory_; |
97 | 93 |
98 DISALLOW_COPY_AND_ASSIGN(FullCardRequest); | 94 DISALLOW_COPY_AND_ASSIGN(FullCardRequest); |
99 }; | 95 }; |
100 | 96 |
101 } // namespace payments | 97 } // namespace payments |
102 } // namespace autofill | 98 } // namespace autofill |
103 | 99 |
104 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ | 100 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ |
OLD | NEW |