Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: components/autofill/core/browser/payments/full_card_request.h

Issue 2794613002: Remove FullCardRequest's dependency on AutofillClient. (Closed)
Patch Set: Address comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 // Used to fetch risk data for this request.
87 // updated expiration date. 87 RiskDataLoader* const risk_data_loader_;
88 AutofillClient* const autofill_client_;
89 88
90 // Responsible for unmasking a masked server card. 89 // Responsible for unmasking a masked server card.
91 payments::PaymentsClient* const payments_client_; 90 payments::PaymentsClient* const payments_client_;
92 91
93 // Responsible for updating the server card on disk after it's been unmasked. 92 // Responsible for updating the server card on disk after it's been unmasked.
94 PersonalDataManager* const personal_data_manager_; 93 PersonalDataManager* const personal_data_manager_;
95 94
96 // Receiver of the full PAN and CVC. 95 // Receiver of the full PAN and CVC.
97 base::WeakPtr<ResultDelegate> result_delegate_; 96 base::WeakPtr<ResultDelegate> result_delegate_;
98 97
(...skipping 14 matching lines...) Expand all
113 // communication is pending. 112 // communication is pending.
114 base::WeakPtrFactory<FullCardRequest> weak_ptr_factory_; 113 base::WeakPtrFactory<FullCardRequest> weak_ptr_factory_;
115 114
116 DISALLOW_COPY_AND_ASSIGN(FullCardRequest); 115 DISALLOW_COPY_AND_ASSIGN(FullCardRequest);
117 }; 116 };
118 117
119 } // namespace payments 118 } // namespace payments
120 } // namespace autofill 119 } // namespace autofill
121 120
122 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_ 121 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_FULL_CARD_REQUEST_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_client.h ('k') | components/autofill/core/browser/payments/full_card_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698