OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_EXPERIMENTS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 struct Feature; | 11 struct Feature; |
12 } | 12 } |
13 | 13 |
14 namespace sync_driver { | 14 namespace sync_driver { |
15 class SyncService; | 15 class SyncService; |
16 } | 16 } |
17 | 17 |
18 class PrefService; | 18 class PrefService; |
19 | 19 |
20 namespace autofill { | 20 namespace autofill { |
21 | 21 |
22 extern const base::Feature kAutofillProfileCleanup; | 22 extern const base::Feature kAutofillProfileCleanup; |
| 23 extern const base::Feature kAutofillCreditCardSigninPromo; |
| 24 extern const char kCreditCardSigninPromoImpressionLimitParamKey[]; |
23 | 25 |
24 // Returns true if autofill should be enabled. See also | 26 // Returns true if autofill should be enabled. See also |
25 // IsInAutofillSuggestionsDisabledExperiment below. | 27 // IsInAutofillSuggestionsDisabledExperiment below. |
26 bool IsAutofillEnabled(const PrefService* pref_service); | 28 bool IsAutofillEnabled(const PrefService* pref_service); |
27 | 29 |
28 // Returns true if autofill suggestions are disabled via experiment. The | 30 // Returns true if autofill suggestions are disabled via experiment. The |
29 // disabled experiment isn't the same as disabling autofill completely since we | 31 // disabled experiment isn't the same as disabling autofill completely since we |
30 // still want to run detection code for metrics purposes. This experiment just | 32 // still want to run detection code for metrics purposes. This experiment just |
31 // disables providing suggestions. | 33 // disables providing suggestions. |
32 bool IsInAutofillSuggestionsDisabledExperiment(); | 34 bool IsInAutofillSuggestionsDisabledExperiment(); |
33 | 35 |
34 // Returns whether the Autofill profile cleanup feature is enabled. | 36 // Returns whether the Autofill profile cleanup feature is enabled. |
35 bool IsAutofillProfileCleanupEnabled(); | 37 bool IsAutofillProfileCleanupEnabled(); |
36 | 38 |
| 39 // Returns whether the Autofill credit card signin promo should be shown. |
| 40 bool IsAutofillCreditCardSigninPromoEnabled(); |
| 41 |
| 42 // Returns the maximum number of impressions of the credit card signin promo, or |
| 43 // 0 if there are no limits. |
| 44 int GetCreditCardSigninPromoImpressionLimit(); |
| 45 |
37 // Returns true if the user should be offered to locally store unmasked cards. | 46 // Returns true if the user should be offered to locally store unmasked cards. |
38 // This controls whether the option is presented at all rather than the default | 47 // This controls whether the option is presented at all rather than the default |
39 // response of the option. | 48 // response of the option. |
40 bool OfferStoreUnmaskedCards(); | 49 bool OfferStoreUnmaskedCards(); |
41 | 50 |
42 // Returns true if uploading credit cards to Wallet servers is enabled. This | 51 // Returns true if uploading credit cards to Wallet servers is enabled. This |
43 // requires the appropriate flags and user settings to be true and the user to | 52 // requires the appropriate flags and user settings to be true and the user to |
44 // be a member of a supported domain. | 53 // be a member of a supported domain. |
45 bool IsCreditCardUploadEnabled(const PrefService* pref_service, | 54 bool IsCreditCardUploadEnabled(const PrefService* pref_service, |
46 const sync_driver::SyncService* sync_service, | 55 const sync_driver::SyncService* sync_service, |
47 const std::string& user_email); | 56 const std::string& user_email); |
48 | 57 |
49 } // namespace autofill | 58 } // namespace autofill |
50 | 59 |
51 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ | 60 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ |
OLD | NEW |