Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: components/autofill/core/browser/autofill_experiments.h

Issue 2531223003: Expanded Autofill Credit Card Popup Layout Experiment in Android. (Closed)
Patch Set: Adds clarification for SkColor Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11
10 class PrefService; 12 class PrefService;
11 13
12 namespace base { 14 namespace base {
13 struct Feature; 15 struct Feature;
14 } 16 }
15 17
16 namespace syncer { 18 namespace syncer {
17 class SyncService; 19 class SyncService;
18 } 20 }
19 21
20 namespace autofill { 22 namespace autofill {
21 23
24 struct Suggestion;
25
22 extern const base::Feature kAutofillCreditCardAssist; 26 extern const base::Feature kAutofillCreditCardAssist;
23 extern const base::Feature kAutofillCreditCardSigninPromo; 27 extern const base::Feature kAutofillCreditCardSigninPromo;
24 extern const base::Feature kAutofillProfileCleanup; 28 extern const base::Feature kAutofillProfileCleanup;
25 extern const base::Feature kAutofillScanCardholderName; 29 extern const base::Feature kAutofillScanCardholderName;
30 extern const base::Feature kAutofillCreditCardPopupLayout;
26 extern const char kCreditCardSigninPromoImpressionLimitParamKey[]; 31 extern const char kCreditCardSigninPromoImpressionLimitParamKey[];
32 extern const char kAutofillCreditCardPopupSettingsSuggestionValueKey[];
27 33
28 // Returns true if autofill should be enabled. See also 34 // Returns true if autofill should be enabled. See also
29 // IsInAutofillSuggestionsDisabledExperiment below. 35 // IsInAutofillSuggestionsDisabledExperiment below.
30 bool IsAutofillEnabled(const PrefService* pref_service); 36 bool IsAutofillEnabled(const PrefService* pref_service);
31 37
32 // Returns true if autofill suggestions are disabled via experiment. The 38 // Returns true if autofill suggestions are disabled via experiment. The
33 // disabled experiment isn't the same as disabling autofill completely since we 39 // disabled experiment isn't the same as disabling autofill completely since we
34 // still want to run detection code for metrics purposes. This experiment just 40 // still want to run detection code for metrics purposes. This experiment just
35 // disables providing suggestions. 41 // disables providing suggestions.
36 bool IsInAutofillSuggestionsDisabledExperiment(); 42 bool IsInAutofillSuggestionsDisabledExperiment();
(...skipping 20 matching lines...) Expand all
57 // requires the appropriate flags and user settings to be true and the user to 63 // requires the appropriate flags and user settings to be true and the user to
58 // be a member of a supported domain. 64 // be a member of a supported domain.
59 bool IsCreditCardUploadEnabled(const PrefService* pref_service, 65 bool IsCreditCardUploadEnabled(const PrefService* pref_service,
60 const syncer::SyncService* sync_service, 66 const syncer::SyncService* sync_service,
61 const std::string& user_email); 67 const std::string& user_email);
62 68
63 // Returns true if the http warning switch is on, which will display a warning 69 // Returns true if the http warning switch is on, which will display a warning
64 // in the autofill dropdown when credit card fields are on an HTTP page. 70 // in the autofill dropdown when credit card fields are on an HTTP page.
65 bool IsCreditCardAutofillHttpWarningEnabled(); 71 bool IsCreditCardAutofillHttpWarningEnabled();
66 72
73 // Returns whether the new Autofill credit card popup layout experiment is
74 // enabled.
75 bool IsAutofillCreditCardPopupLayoutExperimentEnabled();
76
77 // Returns the background color for credit card autofill popup, or 0 if the new
78 // credit card autofill popup layout experiment is not enabled.
79 // TODO(csashi): The Get*Color functions should return SkColor. Temporarily
80 // returning int to bypass the following lint error:
81 // Illegal include: "third_party/skia/include/core/SkColor.h"
Mathieu 2016/11/30 21:27:35 Can you try adding a DEPS rule in components/autof
csashi 2016/12/01 01:13:43 Done.
82 int GetCreditCardPopupBackgroundColor();
83
84 // Returns the divider color for credit card autofill popup, or 0 if the new
85 // credit card autofill popup layout experiment is not enabled.
86 int GetCreditCardPopupDividerColor();
87
88 // Returns true if the credit card autofill popup suggestion value is displayed
89 // in bold type face.
90 bool IsCreditCardPopupValueBold();
91
92 // Returns the dropdown item height for credit card autofill popup, returning
93 // -1 if the dropdown item height isn't configured in an experiment to tweak
94 // autofill popup layout.
95 int GetCreditCardPopupDropdownItemHeight();
96
97 // Returns true if the credit card icon in the autofill popup must be displayed
98 // to the left of the credit card value.
99 bool IsCreditCardIconInPopupAtLeft();
100
101 // Modifies the suggestion label and value if the new credit card autofill popup
102 // experiment is enabled.
103 void ModifyAutofillCreditCardSuggestion(struct Suggestion* suggestion);
104
67 } // namespace autofill 105 } // namespace autofill
68 106
69 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_ 107 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXPERIMENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698