| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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 kAutofillCreditCardSigninPromo; | 28 extern const base::Feature kAutofillCreditCardSigninPromo; |
| 29 extern const base::Feature kAutofillScanCardholderName; | 29 extern const base::Feature kAutofillScanCardholderName; |
| 30 extern const base::Feature kAutofillCreditCardPopupLayout; | 30 extern const base::Feature kAutofillCreditCardPopupLayout; |
| 31 extern const base::Feature kAutofillCreditCardLastUsedDateDisplay; |
| 31 extern const char kCreditCardSigninPromoImpressionLimitParamKey[]; | 32 extern const char kCreditCardSigninPromoImpressionLimitParamKey[]; |
| 32 extern const char kAutofillCreditCardPopupSettingsSuggestionValueKey[]; | 33 extern const char kAutofillCreditCardPopupSettingsSuggestionValueKey[]; |
| 33 | 34 |
| 34 // Returns true if autofill should be enabled. See also | 35 // Returns true if autofill should be enabled. See also |
| 35 // IsInAutofillSuggestionsDisabledExperiment below. | 36 // IsInAutofillSuggestionsDisabledExperiment below. |
| 36 bool IsAutofillEnabled(const PrefService* pref_service); | 37 bool IsAutofillEnabled(const PrefService* pref_service); |
| 37 | 38 |
| 38 // Returns true if autofill suggestions are disabled via experiment. The | 39 // Returns true if autofill suggestions are disabled via experiment. The |
| 39 // 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 |
| 40 // 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 60 // requires the appropriate flags and user settings to be true and the user to | 61 // requires the appropriate flags and user settings to be true and the user to |
| 61 // be a member of a supported domain. | 62 // be a member of a supported domain. |
| 62 bool IsCreditCardUploadEnabled(const PrefService* pref_service, | 63 bool IsCreditCardUploadEnabled(const PrefService* pref_service, |
| 63 const syncer::SyncService* sync_service, | 64 const syncer::SyncService* sync_service, |
| 64 const std::string& user_email); | 65 const std::string& user_email); |
| 65 | 66 |
| 66 // Returns whether the new Autofill credit card popup layout experiment is | 67 // Returns whether the new Autofill credit card popup layout experiment is |
| 67 // enabled. | 68 // enabled. |
| 68 bool IsAutofillCreditCardPopupLayoutExperimentEnabled(); | 69 bool IsAutofillCreditCardPopupLayoutExperimentEnabled(); |
| 69 | 70 |
| 71 // Returns whether Autofill credit card last used date display experiment is |
| 72 // enabled. |
| 73 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled(); |
| 74 |
| 75 // Returns whether Autofill credit card last used date shows expiration date. |
| 76 bool ShowExpirationDateInAutofillCreditCardLastUsedDate(); |
| 77 |
| 78 // Return whether Autofill credit card last used date shows time detail. |
| 79 bool ShowTimeDetailInAutofillCreditCardLastUsedDate(); |
| 80 |
| 70 // Returns the background color for credit card autofill popup, or | 81 // Returns the background color for credit card autofill popup, or |
| 71 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment | 82 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment |
| 72 // is not enabled. | 83 // is not enabled. |
| 73 SkColor GetCreditCardPopupBackgroundColor(); | 84 SkColor GetCreditCardPopupBackgroundColor(); |
| 74 | 85 |
| 75 // Returns the divider color for credit card autofill popup, or | 86 // Returns the divider color for credit card autofill popup, or |
| 76 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment | 87 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment |
| 77 // is not enabled. | 88 // is not enabled. |
| 78 SkColor GetCreditCardPopupDividerColor(); | 89 SkColor GetCreditCardPopupDividerColor(); |
| 79 | 90 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 90 // before the credit card value or any other suggestion text. | 101 // before the credit card value or any other suggestion text. |
| 91 bool IsIconInCreditCardPopupAtStart(); | 102 bool IsIconInCreditCardPopupAtStart(); |
| 92 | 103 |
| 93 // Modifies the suggestion value and label if the new credit card autofill popup | 104 // Modifies the suggestion value and label if the new credit card autofill popup |
| 94 // experiment is enabled to tweak the display of the value and label. | 105 // experiment is enabled to tweak the display of the value and label. |
| 95 void ModifyAutofillCreditCardSuggestion(struct Suggestion* suggestion); | 106 void ModifyAutofillCreditCardSuggestion(struct Suggestion* suggestion); |
| 96 | 107 |
| 97 } // namespace autofill | 108 } // namespace autofill |
| 98 | 109 |
| 99 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ | 110 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ |
| OLD | NEW |