| 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 "components/autofill/core/browser/ui/save_card_bubble_controller.h" |
| 18 #include "ui/base/window_open_disposition.h" | 19 #include "ui/base/window_open_disposition.h" |
| 19 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 20 | 21 |
| 21 class IdentityProvider; | 22 class IdentityProvider; |
| 22 class PrefService; | 23 class PrefService; |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 class RenderFrameHost; | 26 class RenderFrameHost; |
| 26 } | 27 } |
| 27 | 28 |
| (...skipping 75 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 |
| 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 |