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/ui/save_card_bubble_controller.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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 103 |
103 // Gets the sync service associated with the client. | 104 // Gets the sync service associated with the client. |
104 virtual syncer::SyncService* GetSyncService() = 0; | 105 virtual syncer::SyncService* GetSyncService() = 0; |
105 | 106 |
106 // Gets the IdentityProvider associated with the client (for OAuth2). | 107 // Gets the IdentityProvider associated with the client (for OAuth2). |
107 virtual IdentityProvider* GetIdentityProvider() = 0; | 108 virtual IdentityProvider* GetIdentityProvider() = 0; |
108 | 109 |
109 // Gets the RapporServiceImpl associated with the client (for metrics). | 110 // Gets the RapporServiceImpl associated with the client (for metrics). |
110 virtual rappor::RapporServiceImpl* GetRapporServiceImpl() = 0; | 111 virtual rappor::RapporServiceImpl* GetRapporServiceImpl() = 0; |
111 | 112 |
112 // Gets the UKM service assiciated with this client (for metrics). | 113 // Gets the UKM service associated with this client (for metrics). |
113 virtual ukm::UkmService* GetUkmService() = 0; | 114 virtual ukm::UkmService* GetUkmService() = 0; |
114 | 115 |
| 116 // Gets the SaveCardBubbleController instance associated with the client. |
| 117 // May return nullptr if the save card bubble has not been shown yet. |
| 118 virtual SaveCardBubbleController* GetSaveCardBubbleController() = 0; |
| 119 |
115 // Causes the Autofill settings UI to be shown. | 120 // Causes the Autofill settings UI to be shown. |
116 virtual void ShowAutofillSettings() = 0; | 121 virtual void ShowAutofillSettings() = 0; |
117 | 122 |
118 // A user has attempted to use a masked card. Prompt them for further | 123 // A user has attempted to use a masked card. Prompt them for further |
119 // information to proceed. | 124 // information to proceed. |
120 virtual void ShowUnmaskPrompt(const CreditCard& card, | 125 virtual void ShowUnmaskPrompt(const CreditCard& card, |
121 UnmaskCardReason reason, | 126 UnmaskCardReason reason, |
122 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; | 127 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; |
123 virtual void OnUnmaskVerificationResult(PaymentsRpcResult result) = 0; | 128 virtual void OnUnmaskVerificationResult(PaymentsRpcResult result) = 0; |
124 | 129 |
125 // Runs |callback| if the |card| should be imported as personal data. | 130 // Runs |callback| if the |card| should be imported as personal data. |
126 // |metric_logger| can be used to log user actions. | 131 // |metric_logger| can be used to log user actions. |
127 virtual void ConfirmSaveCreditCardLocally(const CreditCard& card, | 132 virtual void ConfirmSaveCreditCardLocally(const CreditCard& card, |
128 const base::Closure& callback) = 0; | 133 const base::Closure& callback) = 0; |
129 | 134 |
130 // Runs |callback| if the |card| should be uploaded to Payments. Displays the | 135 // Runs |callback| if the |card| should be uploaded to Payments. Displays the |
131 // contents of |legal_message| to the user. | 136 // contents of |legal_message| to the user. Display a CVC field in the bubble |
| 137 // if |upload_cvc_should_be_requested| is true. |
132 virtual void ConfirmSaveCreditCardToCloud( | 138 virtual void ConfirmSaveCreditCardToCloud( |
133 const CreditCard& card, | 139 const CreditCard& card, |
134 std::unique_ptr<base::DictionaryValue> legal_message, | 140 std::unique_ptr<base::DictionaryValue> legal_message, |
| 141 const bool upload_cvc_should_be_requested, |
135 const base::Closure& callback) = 0; | 142 const base::Closure& callback) = 0; |
136 | 143 |
137 // Will show an infobar to get user consent for Credit Card assistive filling. | 144 // Will show an infobar to get user consent for Credit Card assistive filling. |
138 // Will run |callback| on success. | 145 // Will run |callback| on success. |
139 virtual void ConfirmCreditCardFillAssist(const CreditCard& card, | 146 virtual void ConfirmCreditCardFillAssist(const CreditCard& card, |
140 const base::Closure& callback) = 0; | 147 const base::Closure& callback) = 0; |
141 | 148 |
142 // Gathers risk data and provides it to |callback|. | 149 // Gathers risk data and provides it to |callback|. |
143 virtual void LoadRiskData( | 150 virtual void LoadRiskData( |
144 const base::Callback<void(const std::string&)>& callback) = 0; | 151 const base::Callback<void(const std::string&)>& callback) = 0; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // returns false. | 203 // returns false. |
197 virtual void StartSigninFlow() = 0; | 204 virtual void StartSigninFlow() = 0; |
198 | 205 |
199 // Shows the explanation of http not secure warning message. | 206 // Shows the explanation of http not secure warning message. |
200 virtual void ShowHttpNotSecureExplanation() = 0; | 207 virtual void ShowHttpNotSecureExplanation() = 0; |
201 }; | 208 }; |
202 | 209 |
203 } // namespace autofill | 210 } // namespace autofill |
204 | 211 |
205 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ | 212 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ |
OLD | NEW |