OLD | NEW |
---|---|
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> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 } | 42 } |
43 | 43 |
44 namespace autofill { | 44 namespace autofill { |
45 | 45 |
46 class AutofillPopupDelegate; | 46 class AutofillPopupDelegate; |
47 class AutofillWebDataService; | 47 class AutofillWebDataService; |
48 class CardUnmaskDelegate; | 48 class CardUnmaskDelegate; |
49 class CreditCard; | 49 class CreditCard; |
50 class FormStructure; | 50 class FormStructure; |
51 class PersonalDataManager; | 51 class PersonalDataManager; |
52 class SaveCardBubbleController; | |
52 struct Suggestion; | 53 struct Suggestion; |
53 | 54 |
54 // A client interface that needs to be supplied to the Autofill component by the | 55 // A client interface that needs to be supplied to the Autofill component by the |
55 // embedder. | 56 // embedder. |
56 // | 57 // |
57 // Each client instance is associated with a given context within which an | 58 // Each client instance is associated with a given context within which an |
58 // AutofillManager is used (e.g. a single tab), so when we say "for the client" | 59 // AutofillManager is used (e.g. a single tab), so when we say "for the client" |
59 // below, we mean "in the execution context the client is associated with" (e.g. | 60 // below, we mean "in the execution context the client is associated with" (e.g. |
60 // for the tab the AutofillManager is attached to). | 61 // for the tab the AutofillManager is attached to). |
61 class AutofillClient : public RiskDataLoader { | 62 class AutofillClient : public RiskDataLoader { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 | 104 |
104 // Gets the sync service associated with the client. | 105 // Gets the sync service associated with the client. |
105 virtual syncer::SyncService* GetSyncService() = 0; | 106 virtual syncer::SyncService* GetSyncService() = 0; |
106 | 107 |
107 // Gets the IdentityProvider associated with the client (for OAuth2). | 108 // Gets the IdentityProvider associated with the client (for OAuth2). |
108 virtual IdentityProvider* GetIdentityProvider() = 0; | 109 virtual IdentityProvider* GetIdentityProvider() = 0; |
109 | 110 |
110 // Gets the RapporServiceImpl associated with the client (for metrics). | 111 // Gets the RapporServiceImpl associated with the client (for metrics). |
111 virtual rappor::RapporServiceImpl* GetRapporServiceImpl() = 0; | 112 virtual rappor::RapporServiceImpl* GetRapporServiceImpl() = 0; |
112 | 113 |
113 // Gets the UKM service assiciated with this client (for metrics). | 114 // Gets the UKM service associated with this client (for metrics). |
114 virtual ukm::UkmService* GetUkmService() = 0; | 115 virtual ukm::UkmService* GetUkmService() = 0; |
115 | 116 |
117 // Gets the SaveCardBubbleController instance associated with the client. | |
118 // May return nullptr if the save card bubble has not been shown yet. | |
119 virtual SaveCardBubbleController* GetSaveCardBubbleController() = 0; | |
120 | |
116 // Causes the Autofill settings UI to be shown. | 121 // Causes the Autofill settings UI to be shown. |
117 virtual void ShowAutofillSettings() = 0; | 122 virtual void ShowAutofillSettings() = 0; |
118 | 123 |
119 // A user has attempted to use a masked card. Prompt them for further | 124 // A user has attempted to use a masked card. Prompt them for further |
120 // information to proceed. | 125 // information to proceed. |
121 virtual void ShowUnmaskPrompt(const CreditCard& card, | 126 virtual void ShowUnmaskPrompt(const CreditCard& card, |
122 UnmaskCardReason reason, | 127 UnmaskCardReason reason, |
123 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; | 128 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; |
124 virtual void OnUnmaskVerificationResult(PaymentsRpcResult result) = 0; | 129 virtual void OnUnmaskVerificationResult(PaymentsRpcResult result) = 0; |
125 | 130 |
126 // Runs |callback| if the |card| should be imported as personal data. | 131 // Runs |callback| if the |card| should be imported as personal data. |
127 // |metric_logger| can be used to log user actions. | 132 // |metric_logger| can be used to log user actions. |
128 virtual void ConfirmSaveCreditCardLocally(const CreditCard& card, | 133 virtual void ConfirmSaveCreditCardLocally(const CreditCard& card, |
129 const base::Closure& callback) = 0; | 134 const base::Closure& callback) = 0; |
130 | 135 |
131 // Runs |callback| if the |card| should be uploaded to Payments. Displays the | 136 // Runs |callback| if the |card| should be uploaded to Payments. Displays the |
132 // contents of |legal_message| to the user. | 137 // contents of |legal_message| to the user. Display a CVC field in the bubble |
Evan Stade
2017/04/12 15:21:31
nit: single space after . (there is not consistenc
Jared Saul
2017/04/12 22:49:21
Done.
| |
138 // if |should_cvc_be_requested| is true. | |
133 virtual void ConfirmSaveCreditCardToCloud( | 139 virtual void ConfirmSaveCreditCardToCloud( |
134 const CreditCard& card, | 140 const CreditCard& card, |
135 std::unique_ptr<base::DictionaryValue> legal_message, | 141 std::unique_ptr<base::DictionaryValue> legal_message, |
142 bool should_cvc_be_requested, | |
136 const base::Closure& callback) = 0; | 143 const base::Closure& callback) = 0; |
137 | 144 |
138 // Will show an infobar to get user consent for Credit Card assistive filling. | 145 // Will show an infobar to get user consent for Credit Card assistive filling. |
139 // Will run |callback| on success. | 146 // Will run |callback| on success. |
140 virtual void ConfirmCreditCardFillAssist(const CreditCard& card, | 147 virtual void ConfirmCreditCardFillAssist(const CreditCard& card, |
141 const base::Closure& callback) = 0; | 148 const base::Closure& callback) = 0; |
142 | 149 |
143 // Returns true if both the platform and the device support scanning credit | 150 // Returns true if both the platform and the device support scanning credit |
144 // cards. Should be called before ScanCreditCard(). | 151 // cards. Should be called before ScanCreditCard(). |
145 virtual bool HasCreditCardScanFeature() = 0; | 152 virtual bool HasCreditCardScanFeature() = 0; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 // returns false. | 200 // returns false. |
194 virtual void StartSigninFlow() = 0; | 201 virtual void StartSigninFlow() = 0; |
195 | 202 |
196 // Shows the explanation of http not secure warning message. | 203 // Shows the explanation of http not secure warning message. |
197 virtual void ShowHttpNotSecureExplanation() = 0; | 204 virtual void ShowHttpNotSecureExplanation() = 0; |
198 }; | 205 }; |
199 | 206 |
200 } // namespace autofill | 207 } // namespace autofill |
201 | 208 |
202 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ | 209 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ |
OLD | NEW |