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> |
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 "components/autofill/core/browser/risk_data_loader.h" |
18 #include "ui/base/window_open_disposition.h" | 18 #include "ui/base/window_open_disposition.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 | 20 |
| 21 #if !defined(OS_ANDROID) |
| 22 #include "components/autofill/core/browser/ui/save_card_bubble_controller.h" |
| 23 #endif |
| 24 |
21 class IdentityProvider; | 25 class IdentityProvider; |
22 class PrefService; | 26 class PrefService; |
23 | 27 |
24 namespace content { | 28 namespace content { |
25 class RenderFrameHost; | 29 class RenderFrameHost; |
26 } | 30 } |
27 | 31 |
28 namespace gfx { | 32 namespace gfx { |
29 class RectF; | 33 class RectF; |
30 } | 34 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 107 |
104 // Gets the sync service associated with the client. | 108 // Gets the sync service associated with the client. |
105 virtual syncer::SyncService* GetSyncService() = 0; | 109 virtual syncer::SyncService* GetSyncService() = 0; |
106 | 110 |
107 // Gets the IdentityProvider associated with the client (for OAuth2). | 111 // Gets the IdentityProvider associated with the client (for OAuth2). |
108 virtual IdentityProvider* GetIdentityProvider() = 0; | 112 virtual IdentityProvider* GetIdentityProvider() = 0; |
109 | 113 |
110 // Gets the RapporServiceImpl associated with the client (for metrics). | 114 // Gets the RapporServiceImpl associated with the client (for metrics). |
111 virtual rappor::RapporServiceImpl* GetRapporServiceImpl() = 0; | 115 virtual rappor::RapporServiceImpl* GetRapporServiceImpl() = 0; |
112 | 116 |
113 // Gets the UKM service assiciated with this client (for metrics). | 117 // Gets the UKM service associated with this client (for metrics). |
114 virtual ukm::UkmService* GetUkmService() = 0; | 118 virtual ukm::UkmService* GetUkmService() = 0; |
115 | 119 |
| 120 #if !defined(OS_ANDROID) |
| 121 // Gets the SaveCardBubbleController instance associated with the client. |
| 122 // May return nullptr if the save card bubble has not been shown yet. |
| 123 virtual SaveCardBubbleController* GetSaveCardBubbleController() = 0; |
| 124 #endif |
| 125 |
116 // Causes the Autofill settings UI to be shown. | 126 // Causes the Autofill settings UI to be shown. |
117 virtual void ShowAutofillSettings() = 0; | 127 virtual void ShowAutofillSettings() = 0; |
118 | 128 |
119 // A user has attempted to use a masked card. Prompt them for further | 129 // A user has attempted to use a masked card. Prompt them for further |
120 // information to proceed. | 130 // information to proceed. |
121 virtual void ShowUnmaskPrompt(const CreditCard& card, | 131 virtual void ShowUnmaskPrompt(const CreditCard& card, |
122 UnmaskCardReason reason, | 132 UnmaskCardReason reason, |
123 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; | 133 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; |
124 virtual void OnUnmaskVerificationResult(PaymentsRpcResult result) = 0; | 134 virtual void OnUnmaskVerificationResult(PaymentsRpcResult result) = 0; |
125 | 135 |
126 // Runs |callback| if the |card| should be imported as personal data. | 136 // Runs |callback| if the |card| should be imported as personal data. |
127 // |metric_logger| can be used to log user actions. | 137 // |metric_logger| can be used to log user actions. |
128 virtual void ConfirmSaveCreditCardLocally(const CreditCard& card, | 138 virtual void ConfirmSaveCreditCardLocally(const CreditCard& card, |
129 const base::Closure& callback) = 0; | 139 const base::Closure& callback) = 0; |
130 | 140 |
131 // Runs |callback| if the |card| should be uploaded to Payments. Displays the | 141 // Runs |callback| if the |card| should be uploaded to Payments. Displays the |
132 // contents of |legal_message| to the user. | 142 // contents of |legal_message| to the user. Display a CVC field in the bubble |
| 143 // if |should_cvc_be_requested| is true. |
133 virtual void ConfirmSaveCreditCardToCloud( | 144 virtual void ConfirmSaveCreditCardToCloud( |
134 const CreditCard& card, | 145 const CreditCard& card, |
135 std::unique_ptr<base::DictionaryValue> legal_message, | 146 std::unique_ptr<base::DictionaryValue> legal_message, |
| 147 bool should_cvc_be_requested, |
136 const base::Closure& callback) = 0; | 148 const base::Closure& callback) = 0; |
137 | 149 |
138 // Will show an infobar to get user consent for Credit Card assistive filling. | 150 // Will show an infobar to get user consent for Credit Card assistive filling. |
139 // Will run |callback| on success. | 151 // Will run |callback| on success. |
140 virtual void ConfirmCreditCardFillAssist(const CreditCard& card, | 152 virtual void ConfirmCreditCardFillAssist(const CreditCard& card, |
141 const base::Closure& callback) = 0; | 153 const base::Closure& callback) = 0; |
142 | 154 |
143 // Returns true if both the platform and the device support scanning credit | 155 // Returns true if both the platform and the device support scanning credit |
144 // cards. Should be called before ScanCreditCard(). | 156 // cards. Should be called before ScanCreditCard(). |
145 virtual bool HasCreditCardScanFeature() = 0; | 157 virtual bool HasCreditCardScanFeature() = 0; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // returns false. | 205 // returns false. |
194 virtual void StartSigninFlow() = 0; | 206 virtual void StartSigninFlow() = 0; |
195 | 207 |
196 // Shows the explanation of http not secure warning message. | 208 // Shows the explanation of http not secure warning message. |
197 virtual void ShowHttpNotSecureExplanation() = 0; | 209 virtual void ShowHttpNotSecureExplanation() = 0; |
198 }; | 210 }; |
199 | 211 |
200 } // namespace autofill | 212 } // namespace autofill |
201 | 213 |
202 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ | 214 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ |
OLD | NEW |