| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 void OnDidGetRealPan(AutofillClient::PaymentsRpcResult result, | 54 void OnDidGetRealPan(AutofillClient::PaymentsRpcResult result, |
| 55 const std::string& real_pan); | 55 const std::string& real_pan); |
| 56 private: | 56 private: |
| 57 // CardUnmaskDelegate: | 57 // CardUnmaskDelegate: |
| 58 void OnUnmaskResponse(const UnmaskResponse& response) override; | 58 void OnUnmaskResponse(const UnmaskResponse& response) override; |
| 59 void OnUnmaskPromptClosed() override; | 59 void OnUnmaskPromptClosed() override; |
| 60 | 60 |
| 61 // Called by autofill client when the risk data has been loaded. | 61 // Called by autofill client when the risk data has been loaded. |
| 62 void OnDidGetUnmaskRiskData(const std::string& risk_data); | 62 void OnDidGetUnmaskRiskData(const std::string& risk_data); |
| 63 | 63 |
| 64 // Resets the state of the request. |
| 65 void Reset(); |
| 66 |
| 64 // Responsible for showing the UI that prompts the user for the CVC and/or the | 67 // Responsible for showing the UI that prompts the user for the CVC and/or the |
| 65 // updated expiration date. | 68 // updated expiration date. |
| 66 AutofillClient* const autofill_client_; | 69 AutofillClient* const autofill_client_; |
| 67 | 70 |
| 68 // Responsible for unmasking a masked server card. | 71 // Responsible for unmasking a masked server card. |
| 69 payments::PaymentsClient* const payments_client_; | 72 payments::PaymentsClient* const payments_client_; |
| 70 | 73 |
| 71 // Responsible for updating the server card on disk after it's been unmasked. | 74 // Responsible for updating the server card on disk after it's been unmasked. |
| 72 PersonalDataManager* const personal_data_manager_; | 75 PersonalDataManager* const personal_data_manager_; |
| 73 | 76 |
| 74 // Receiver of the full PAN and CVC. | 77 // Receiver of the full PAN and CVC. |
| 75 base::WeakPtr<Delegate> delegate_; | 78 base::WeakPtr<Delegate> delegate_; |
| 76 | 79 |
| 77 // The pending request to get a card's full PAN and CVC. | 80 // The pending request to get a card's full PAN and CVC. |
| 78 std::unique_ptr<payments::PaymentsClient::UnmaskRequestDetails> request_; | 81 std::unique_ptr<payments::PaymentsClient::UnmaskRequestDetails> request_; |
| 79 | 82 |
| 83 // Whether the card unmask request should be sent to the payment server. |
| 84 bool should_unmask_card_; |
| 85 |
| 80 // The timestamp when the full PAN was requested from a server. For | 86 // The timestamp when the full PAN was requested from a server. For |
| 81 // histograms. | 87 // histograms. |
| 82 base::Time real_pan_request_timestamp_; | 88 base::Time real_pan_request_timestamp_; |
| 83 | 89 |
| 84 // Enables destroying FullCardRequest while CVC prompt is showing or a server | 90 // Enables destroying FullCardRequest while CVC prompt is showing or a server |
| 85 // communication is pending. | 91 // communication is pending. |
| 86 base::WeakPtrFactory<FullCardRequest> weak_ptr_factory_; | 92 base::WeakPtrFactory<FullCardRequest> weak_ptr_factory_; |
| 87 | 93 |
| 88 DISALLOW_COPY_AND_ASSIGN(FullCardRequest); | 94 DISALLOW_COPY_AND_ASSIGN(FullCardRequest); |
| 89 }; | 95 }; |
| 90 | 96 |
| 91 } // namespace payments | 97 } // namespace payments |
| 92 } // namespace autofill | 98 } // namespace autofill |
| 93 | 99 |
| 94 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ | 100 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ |
| OLD | NEW |