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 <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "ui/base/window_open_disposition.h" | 16 #include "ui/base/window_open_disposition.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 class IdentityProvider; | 19 class IdentityProvider; |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 class RenderFrameHost; | 22 class RenderFrameHost; |
23 } | 23 } |
24 | 24 |
25 namespace gfx { | 25 namespace gfx { |
26 class Rect; | 26 class Rect; |
27 class RectF; | 27 class RectF; |
28 } | 28 } |
29 | 29 |
| 30 #if defined(OS_ANDROID) |
| 31 namespace infobars { |
| 32 class InfoBar; |
| 33 } |
| 34 #endif |
| 35 |
30 namespace rappor { | 36 namespace rappor { |
31 class RapporService; | 37 class RapporService; |
32 } | 38 } |
33 | 39 |
34 namespace sync_driver { | 40 namespace sync_driver { |
35 class SyncService; | 41 class SyncService; |
36 } | 42 } |
37 | 43 |
38 class GURL; | 44 class GURL; |
39 class PrefService; | 45 class PrefService; |
40 | 46 |
41 namespace autofill { | 47 namespace autofill { |
42 | 48 |
| 49 #if defined(OS_ANDROID) |
| 50 class AutofillCreditCardFillingInfoBarDelegateMobile; |
| 51 #endif |
43 class AutofillPopupDelegate; | 52 class AutofillPopupDelegate; |
44 class AutofillWebDataService; | 53 class AutofillWebDataService; |
45 class CardUnmaskDelegate; | 54 class CardUnmaskDelegate; |
46 class CreditCard; | 55 class CreditCard; |
47 class FormStructure; | 56 class FormStructure; |
48 class PersonalDataManager; | 57 class PersonalDataManager; |
49 struct FormData; | 58 struct FormData; |
50 struct Suggestion; | 59 struct Suggestion; |
51 | 60 |
52 // A client interface that needs to be supplied to the Autofill component by the | 61 // A client interface that needs to be supplied to the Autofill component by the |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 virtual void ConfirmSaveCreditCardLocally(const CreditCard& card, | 134 virtual void ConfirmSaveCreditCardLocally(const CreditCard& card, |
126 const base::Closure& callback) = 0; | 135 const base::Closure& callback) = 0; |
127 | 136 |
128 // Runs |callback| if the |card| should be uploaded to Payments. Displays the | 137 // Runs |callback| if the |card| should be uploaded to Payments. Displays the |
129 // contents of |legal_message| to the user. | 138 // contents of |legal_message| to the user. |
130 virtual void ConfirmSaveCreditCardToCloud( | 139 virtual void ConfirmSaveCreditCardToCloud( |
131 const CreditCard& card, | 140 const CreditCard& card, |
132 std::unique_ptr<base::DictionaryValue> legal_message, | 141 std::unique_ptr<base::DictionaryValue> legal_message, |
133 const base::Closure& callback) = 0; | 142 const base::Closure& callback) = 0; |
134 | 143 |
| 144 // Will show an infobar to get user consent for Credit Card assistive filling. |
| 145 // Will run |callback| on success. |
| 146 virtual void ConfirmCreditCardFillAssist(const CreditCard& card, |
| 147 const base::Closure& callback) = 0; |
| 148 |
| 149 #if defined(OS_ANDROID) |
| 150 // Creates an infobar to prompt the user for credit card assisted filling. |
| 151 // See autofill_credit_card_filling_infobar.h for details. |
| 152 virtual std::unique_ptr<infobars::InfoBar> CreateCreditCardFillingInfoBar( |
| 153 std::unique_ptr<AutofillCreditCardFillingInfoBarDelegateMobile> |
| 154 delegate) = 0; |
| 155 #endif |
| 156 |
135 // Gathers risk data and provides it to |callback|. | 157 // Gathers risk data and provides it to |callback|. |
136 virtual void LoadRiskData( | 158 virtual void LoadRiskData( |
137 const base::Callback<void(const std::string&)>& callback) = 0; | 159 const base::Callback<void(const std::string&)>& callback) = 0; |
138 | 160 |
139 // Returns true if both the platform and the device support scanning credit | 161 // Returns true if both the platform and the device support scanning credit |
140 // cards. Should be called before ScanCreditCard(). | 162 // cards. Should be called before ScanCreditCard(). |
141 virtual bool HasCreditCardScanFeature() = 0; | 163 virtual bool HasCreditCardScanFeature() = 0; |
142 | 164 |
143 // Shows the user interface for scanning a credit card. Invokes the |callback| | 165 // Shows the user interface for scanning a credit card. Invokes the |callback| |
144 // when a credit card is scanned successfully. Should be called only if | 166 // when a credit card is scanned successfully. Should be called only if |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 virtual bool ShouldShowSigninPromo() = 0; | 208 virtual bool ShouldShowSigninPromo() = 0; |
187 | 209 |
188 // Starts the signin flow. Should not be called if ShouldShowSigninPromo() | 210 // Starts the signin flow. Should not be called if ShouldShowSigninPromo() |
189 // returns false. | 211 // returns false. |
190 virtual void StartSigninFlow() = 0; | 212 virtual void StartSigninFlow() = 0; |
191 }; | 213 }; |
192 | 214 |
193 } // namespace autofill | 215 } // namespace autofill |
194 | 216 |
195 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ | 217 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ |
OLD | NEW |