| 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 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 12 | 12 |
| 13 class PrefService; | 13 class PrefService; |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 struct Feature; | 16 struct Feature; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace syncer { | 19 namespace syncer { |
| 20 class SyncService; | 20 class SyncService; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace autofill { | 23 namespace autofill { |
| 24 | 24 |
| 25 struct Suggestion; | 25 struct Suggestion; |
| 26 | 26 |
| 27 extern const base::Feature kAutofillCreditCardAssist; | 27 extern const base::Feature kAutofillCreditCardAssist; |
| 28 extern const base::Feature kAutofillScanCardholderName; | 28 extern const base::Feature kAutofillScanCardholderName; |
| 29 extern const base::Feature kAutofillCreditCardPopupLayout; | 29 extern const base::Feature kAutofillCreditCardPopupLayout; |
| 30 extern const base::Feature kAutofillCreditCardLastUsedDateDisplay; |
| 30 extern const char kCreditCardSigninPromoImpressionLimitParamKey[]; | 31 extern const char kCreditCardSigninPromoImpressionLimitParamKey[]; |
| 31 extern const char kAutofillCreditCardPopupSettingsSuggestionValueKey[]; | 32 extern const char kAutofillCreditCardPopupSettingsSuggestionValueKey[]; |
| 33 extern const char kAutofillCreditCardLastUsedDateShowExpirationDateKey[]; |
| 32 | 34 |
| 33 // Returns true if autofill should be enabled. See also | 35 // Returns true if autofill should be enabled. See also |
| 34 // IsInAutofillSuggestionsDisabledExperiment below. | 36 // IsInAutofillSuggestionsDisabledExperiment below. |
| 35 bool IsAutofillEnabled(const PrefService* pref_service); | 37 bool IsAutofillEnabled(const PrefService* pref_service); |
| 36 | 38 |
| 37 // Returns true if autofill suggestions are disabled via experiment. The | 39 // Returns true if autofill suggestions are disabled via experiment. The |
| 38 // disabled experiment isn't the same as disabling autofill completely since we | 40 // disabled experiment isn't the same as disabling autofill completely since we |
| 39 // still want to run detection code for metrics purposes. This experiment just | 41 // still want to run detection code for metrics purposes. This experiment just |
| 40 // disables providing suggestions. | 42 // disables providing suggestions. |
| 41 bool IsInAutofillSuggestionsDisabledExperiment(); | 43 bool IsInAutofillSuggestionsDisabledExperiment(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 // requires the appropriate flags and user settings to be true and the user to | 54 // requires the appropriate flags and user settings to be true and the user to |
| 53 // be a member of a supported domain. | 55 // be a member of a supported domain. |
| 54 bool IsCreditCardUploadEnabled(const PrefService* pref_service, | 56 bool IsCreditCardUploadEnabled(const PrefService* pref_service, |
| 55 const syncer::SyncService* sync_service, | 57 const syncer::SyncService* sync_service, |
| 56 const std::string& user_email); | 58 const std::string& user_email); |
| 57 | 59 |
| 58 // Returns whether the new Autofill credit card popup layout experiment is | 60 // Returns whether the new Autofill credit card popup layout experiment is |
| 59 // enabled. | 61 // enabled. |
| 60 bool IsAutofillCreditCardPopupLayoutExperimentEnabled(); | 62 bool IsAutofillCreditCardPopupLayoutExperimentEnabled(); |
| 61 | 63 |
| 64 // Returns whether Autofill credit card last used date display experiment is |
| 65 // enabled. |
| 66 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled(); |
| 67 |
| 68 // Returns whether Autofill credit card last used date shows expiration date. |
| 69 bool ShowExpirationDateInAutofillCreditCardLastUsedDate(); |
| 70 |
| 62 // Returns the background color for credit card autofill popup, or | 71 // Returns the background color for credit card autofill popup, or |
| 63 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment | 72 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment |
| 64 // is not enabled. | 73 // is not enabled. |
| 65 SkColor GetCreditCardPopupBackgroundColor(); | 74 SkColor GetCreditCardPopupBackgroundColor(); |
| 66 | 75 |
| 67 // Returns the divider color for credit card autofill popup, or | 76 // Returns the divider color for credit card autofill popup, or |
| 68 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment | 77 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment |
| 69 // is not enabled. | 78 // is not enabled. |
| 70 SkColor GetCreditCardPopupDividerColor(); | 79 SkColor GetCreditCardPopupDividerColor(); |
| 71 | 80 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 87 void ModifyAutofillCreditCardSuggestion(struct Suggestion* suggestion); | 96 void ModifyAutofillCreditCardSuggestion(struct Suggestion* suggestion); |
| 88 | 97 |
| 89 // Returns the margin for the icon, label and between icon and label. Returns 0 | 98 // Returns the margin for the icon, label and between icon and label. Returns 0 |
| 90 // if the margin isn't configured in an experiment to tweak autofill popup | 99 // if the margin isn't configured in an experiment to tweak autofill popup |
| 91 // layout. | 100 // layout. |
| 92 unsigned int GetPopupMargin(); | 101 unsigned int GetPopupMargin(); |
| 93 | 102 |
| 94 } // namespace autofill | 103 } // namespace autofill |
| 95 | 104 |
| 96 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ | 105 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ |
| OLD | NEW |