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

Side by Side Diff: components/autofill/core/browser/autofill_client.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_AUTOFILL_CLIENT_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "components/autofill/core/browser/risk_data_loader.h"
17 #include "ui/base/window_open_disposition.h" 18 #include "ui/base/window_open_disposition.h"
18 #include "url/gurl.h" 19 #include "url/gurl.h"
19 20
20 class IdentityProvider; 21 class IdentityProvider;
21 class PrefService; 22 class PrefService;
22 23
23 namespace content { 24 namespace content {
24 class RenderFrameHost; 25 class RenderFrameHost;
25 } 26 }
26 27
(...skipping 23 matching lines...) Expand all
50 class PersonalDataManager; 51 class PersonalDataManager;
51 struct Suggestion; 52 struct Suggestion;
52 53
53 // A client interface that needs to be supplied to the Autofill component by the 54 // A client interface that needs to be supplied to the Autofill component by the
54 // embedder. 55 // embedder.
55 // 56 //
56 // Each client instance is associated with a given context within which an 57 // Each client instance is associated with a given context within which an
57 // AutofillManager is used (e.g. a single tab), so when we say "for the client" 58 // AutofillManager is used (e.g. a single tab), so when we say "for the client"
58 // below, we mean "in the execution context the client is associated with" (e.g. 59 // below, we mean "in the execution context the client is associated with" (e.g.
59 // for the tab the AutofillManager is attached to). 60 // for the tab the AutofillManager is attached to).
60 class AutofillClient { 61 class AutofillClient : public RiskDataLoader {
61 public: 62 public:
62 enum PaymentsRpcResult { 63 enum PaymentsRpcResult {
63 // Empty result. Used for initializing variables and should generally 64 // Empty result. Used for initializing variables and should generally
64 // not be returned nor passed as arguments unless explicitly allowed by 65 // not be returned nor passed as arguments unless explicitly allowed by
65 // the API. 66 // the API.
66 NONE, 67 NONE,
67 68
68 // Request succeeded. 69 // Request succeeded.
69 SUCCESS, 70 SUCCESS,
70 71
(...skipping 11 matching lines...) Expand all
82 enum UnmaskCardReason { 83 enum UnmaskCardReason {
83 // The card is being unmasked for PaymentRequest. 84 // The card is being unmasked for PaymentRequest.
84 UNMASK_FOR_PAYMENT_REQUEST, 85 UNMASK_FOR_PAYMENT_REQUEST,
85 86
86 // The card is being unmasked for Autofill. 87 // The card is being unmasked for Autofill.
87 UNMASK_FOR_AUTOFILL, 88 UNMASK_FOR_AUTOFILL,
88 }; 89 };
89 90
90 typedef base::Callback<void(const CreditCard&)> CreditCardScanCallback; 91 typedef base::Callback<void(const CreditCard&)> CreditCardScanCallback;
91 92
92 virtual ~AutofillClient() {} 93 ~AutofillClient() override {}
93 94
94 // Gets the PersonalDataManager instance associated with the client. 95 // Gets the PersonalDataManager instance associated with the client.
95 virtual PersonalDataManager* GetPersonalDataManager() = 0; 96 virtual PersonalDataManager* GetPersonalDataManager() = 0;
96 97
97 // Gets the AutofillWebDataService instance associated with the client. 98 // Gets the AutofillWebDataService instance associated with the client.
98 virtual scoped_refptr<AutofillWebDataService> GetDatabase() = 0; 99 virtual scoped_refptr<AutofillWebDataService> GetDatabase() = 0;
99 100
100 // Gets the preferences associated with the client. 101 // Gets the preferences associated with the client.
101 virtual PrefService* GetPrefs() = 0; 102 virtual PrefService* GetPrefs() = 0;
102 103
(...skipping 29 matching lines...) Expand all
132 virtual void ConfirmSaveCreditCardToCloud( 133 virtual void ConfirmSaveCreditCardToCloud(
133 const CreditCard& card, 134 const CreditCard& card,
134 std::unique_ptr<base::DictionaryValue> legal_message, 135 std::unique_ptr<base::DictionaryValue> legal_message,
135 const base::Closure& callback) = 0; 136 const base::Closure& callback) = 0;
136 137
137 // Will show an infobar to get user consent for Credit Card assistive filling. 138 // Will show an infobar to get user consent for Credit Card assistive filling.
138 // Will run |callback| on success. 139 // Will run |callback| on success.
139 virtual void ConfirmCreditCardFillAssist(const CreditCard& card, 140 virtual void ConfirmCreditCardFillAssist(const CreditCard& card,
140 const base::Closure& callback) = 0; 141 const base::Closure& callback) = 0;
141 142
142 // Gathers risk data and provides it to |callback|.
143 virtual void LoadRiskData(
144 const base::Callback<void(const std::string&)>& callback) = 0;
145
146 // Returns true if both the platform and the device support scanning credit 143 // Returns true if both the platform and the device support scanning credit
147 // cards. Should be called before ScanCreditCard(). 144 // cards. Should be called before ScanCreditCard().
148 virtual bool HasCreditCardScanFeature() = 0; 145 virtual bool HasCreditCardScanFeature() = 0;
149 146
150 // Shows the user interface for scanning a credit card. Invokes the |callback| 147 // Shows the user interface for scanning a credit card. Invokes the |callback|
151 // when a credit card is scanned successfully. Should be called only if 148 // when a credit card is scanned successfully. Should be called only if
152 // HasCreditCardScanFeature() returns true. 149 // HasCreditCardScanFeature() returns true.
153 virtual void ScanCreditCard(const CreditCardScanCallback& callback) = 0; 150 virtual void ScanCreditCard(const CreditCardScanCallback& callback) = 0;
154 151
155 // Shows an Autofill popup with the given |values|, |labels|, |icons|, and 152 // Shows an Autofill popup with the given |values|, |labels|, |icons|, and
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // returns false. 193 // returns false.
197 virtual void StartSigninFlow() = 0; 194 virtual void StartSigninFlow() = 0;
198 195
199 // Shows the explanation of http not secure warning message. 196 // Shows the explanation of http not secure warning message.
200 virtual void ShowHttpNotSecureExplanation() = 0; 197 virtual void ShowHttpNotSecureExplanation() = 0;
201 }; 198 };
202 199
203 } // namespace autofill 200 } // namespace autofill
204 201
205 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ 202 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/BUILD.gn ('k') | components/autofill/core/browser/payments/full_card_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698