Chromium Code Reviews| 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 30 matching lines...) Expand all Loading... | |
| 41 virtual ~UIDelegate() = default; | 41 virtual ~UIDelegate() = default; |
| 42 virtual void ShowUnmaskPrompt( | 42 virtual void ShowUnmaskPrompt( |
| 43 const CreditCard& card, | 43 const CreditCard& card, |
| 44 AutofillClient::UnmaskCardReason reason, | 44 AutofillClient::UnmaskCardReason reason, |
| 45 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; | 45 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; |
| 46 virtual void OnUnmaskVerificationResult( | 46 virtual void OnUnmaskVerificationResult( |
| 47 AutofillClient::PaymentsRpcResult result) = 0; | 47 AutofillClient::PaymentsRpcResult result) = 0; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // The parameters should outlive the FullCardRequest. | 50 // The parameters should outlive the FullCardRequest. |
| 51 FullCardRequest(AutofillClient* autofill_client, | 51 FullCardRequest(RiskDataLoader* risk_data_loader, |
| 52 payments::PaymentsClient* payments_client, | 52 payments::PaymentsClient* payments_client, |
| 53 PersonalDataManager* personal_data_manager); | 53 PersonalDataManager* personal_data_manager); |
| 54 ~FullCardRequest(); | 54 ~FullCardRequest(); |
| 55 | 55 |
| 56 // Retrieves the pan and cvc for |card| and invokes | 56 // Retrieves the pan and cvc for |card| and invokes |
| 57 // Delegate::OnFullCardRequestSucceeded() or | 57 // Delegate::OnFullCardRequestSucceeded() or |
| 58 // Delegate::OnFullCardRequestFailed(). Only one request should be active at a | 58 // Delegate::OnFullCardRequestFailed(). Only one request should be active at a |
| 59 // time. | 59 // time. |
| 60 // | 60 // |
| 61 // If the card is local, has a non-empty GUID, and the user has updated its | 61 // If the card is local, has a non-empty GUID, and the user has updated its |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 76 // CardUnmaskDelegate: | 76 // CardUnmaskDelegate: |
| 77 void OnUnmaskResponse(const UnmaskResponse& response) override; | 77 void OnUnmaskResponse(const UnmaskResponse& response) override; |
| 78 void OnUnmaskPromptClosed() override; | 78 void OnUnmaskPromptClosed() override; |
| 79 | 79 |
| 80 // Called by autofill client when the risk data has been loaded. | 80 // Called by autofill client when the risk data has been loaded. |
| 81 void OnDidGetUnmaskRiskData(const std::string& risk_data); | 81 void OnDidGetUnmaskRiskData(const std::string& risk_data); |
| 82 | 82 |
| 83 // Resets the state of the request. | 83 // Resets the state of the request. |
| 84 void Reset(); | 84 void Reset(); |
| 85 | 85 |
| 86 // Responsible for showing the UI that prompts the user for the CVC and/or the | 86 // Responsible for showing the UI that prompts the user for the CVC and/or the |
|
Mathieu
2017/03/31 19:04:03
let's update this comment
| |
| 87 // updated expiration date. | 87 // updated expiration date. |
| 88 AutofillClient* const autofill_client_; | 88 RiskDataLoader* const risk_data_loader_; |
| 89 | 89 |
| 90 // Responsible for unmasking a masked server card. | 90 // Responsible for unmasking a masked server card. |
| 91 payments::PaymentsClient* const payments_client_; | 91 payments::PaymentsClient* const payments_client_; |
| 92 | 92 |
| 93 // Responsible for updating the server card on disk after it's been unmasked. | 93 // Responsible for updating the server card on disk after it's been unmasked. |
| 94 PersonalDataManager* const personal_data_manager_; | 94 PersonalDataManager* const personal_data_manager_; |
| 95 | 95 |
| 96 // Receiver of the full PAN and CVC. | 96 // Receiver of the full PAN and CVC. |
| 97 base::WeakPtr<ResultDelegate> result_delegate_; | 97 base::WeakPtr<ResultDelegate> result_delegate_; |
| 98 | 98 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 113 // communication is pending. | 113 // communication is pending. |
| 114 base::WeakPtrFactory<FullCardRequest> weak_ptr_factory_; | 114 base::WeakPtrFactory<FullCardRequest> weak_ptr_factory_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(FullCardRequest); | 116 DISALLOW_COPY_AND_ASSIGN(FullCardRequest); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace payments | 119 } // namespace payments |
| 120 } // namespace autofill | 120 } // namespace autofill |
| 121 | 121 |
| 122 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ | 122 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ |
| OLD | NEW |