| 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[]; |
| 34 extern const char kAutofillCreditCardLastUsedDateShowTimeDetailKey[]; |
| 32 | 35 |
| 33 // Returns true if autofill should be enabled. See also | 36 // Returns true if autofill should be enabled. See also |
| 34 // IsInAutofillSuggestionsDisabledExperiment below. | 37 // IsInAutofillSuggestionsDisabledExperiment below. |
| 35 bool IsAutofillEnabled(const PrefService* pref_service); | 38 bool IsAutofillEnabled(const PrefService* pref_service); |
| 36 | 39 |
| 37 // Returns true if autofill suggestions are disabled via experiment. The | 40 // Returns true if autofill suggestions are disabled via experiment. The |
| 38 // disabled experiment isn't the same as disabling autofill completely since we | 41 // 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 | 42 // still want to run detection code for metrics purposes. This experiment just |
| 40 // disables providing suggestions. | 43 // disables providing suggestions. |
| 41 bool IsInAutofillSuggestionsDisabledExperiment(); | 44 bool IsInAutofillSuggestionsDisabledExperiment(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 // requires the appropriate flags and user settings to be true and the user to | 55 // requires the appropriate flags and user settings to be true and the user to |
| 53 // be a member of a supported domain. | 56 // be a member of a supported domain. |
| 54 bool IsCreditCardUploadEnabled(const PrefService* pref_service, | 57 bool IsCreditCardUploadEnabled(const PrefService* pref_service, |
| 55 const syncer::SyncService* sync_service, | 58 const syncer::SyncService* sync_service, |
| 56 const std::string& user_email); | 59 const std::string& user_email); |
| 57 | 60 |
| 58 // Returns whether the new Autofill credit card popup layout experiment is | 61 // Returns whether the new Autofill credit card popup layout experiment is |
| 59 // enabled. | 62 // enabled. |
| 60 bool IsAutofillCreditCardPopupLayoutExperimentEnabled(); | 63 bool IsAutofillCreditCardPopupLayoutExperimentEnabled(); |
| 61 | 64 |
| 65 // Returns whether Autofill credit card last used date display experiment is |
| 66 // enabled. |
| 67 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled(); |
| 68 |
| 69 // Returns whether Autofill credit card last used date shows expiration date. |
| 70 bool ShowExpirationDateInAutofillCreditCardLastUsedDate(); |
| 71 |
| 72 // Return whether Autofill credit card last used date shows time detail. |
| 73 bool ShowTimeDetailInAutofillCreditCardLastUsedDate(); |
| 74 |
| 62 // Returns the background color for credit card autofill popup, or | 75 // Returns the background color for credit card autofill popup, or |
| 63 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment | 76 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment |
| 64 // is not enabled. | 77 // is not enabled. |
| 65 SkColor GetCreditCardPopupBackgroundColor(); | 78 SkColor GetCreditCardPopupBackgroundColor(); |
| 66 | 79 |
| 67 // Returns the divider color for credit card autofill popup, or | 80 // Returns the divider color for credit card autofill popup, or |
| 68 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment | 81 // |SK_ColorTRANSPARENT| if the new credit card autofill popup layout experiment |
| 69 // is not enabled. | 82 // is not enabled. |
| 70 SkColor GetCreditCardPopupDividerColor(); | 83 SkColor GetCreditCardPopupDividerColor(); |
| 71 | 84 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 82 // before the credit card value or any other suggestion text. | 95 // before the credit card value or any other suggestion text. |
| 83 bool IsIconInCreditCardPopupAtStart(); | 96 bool IsIconInCreditCardPopupAtStart(); |
| 84 | 97 |
| 85 // Modifies the suggestion value and label if the new credit card autofill popup | 98 // Modifies the suggestion value and label if the new credit card autofill popup |
| 86 // experiment is enabled to tweak the display of the value and label. | 99 // experiment is enabled to tweak the display of the value and label. |
| 87 void ModifyAutofillCreditCardSuggestion(struct Suggestion* suggestion); | 100 void ModifyAutofillCreditCardSuggestion(struct Suggestion* suggestion); |
| 88 | 101 |
| 89 } // namespace autofill | 102 } // namespace autofill |
| 90 | 103 |
| 91 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ | 104 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ |
| OLD | NEW |