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 #include "components/autofill/core/browser/autofill_experiments.h" | 5 #include "components/autofill/core/browser/autofill_experiments.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 85 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
86 switches::kDisableOfferStoreUnmaskedWalletCards)) | 86 switches::kDisableOfferStoreUnmaskedWalletCards)) |
87 return false; | 87 return false; |
88 | 88 |
89 // Otherwise use the field trial to show the checkbox or not. | 89 // Otherwise use the field trial to show the checkbox or not. |
90 return group_name != "Disabled"; | 90 return group_name != "Disabled"; |
91 #endif | 91 #endif |
92 } | 92 } |
93 | 93 |
94 bool IsCreditCardUploadEnabled(const PrefService* pref_service, | 94 bool IsCreditCardUploadEnabled(const PrefService* pref_service, |
95 const sync_driver::SyncService* sync_service, | 95 const syncer::SyncService* sync_service, |
96 const std::string& user_email) { | 96 const std::string& user_email) { |
97 // Query the field trial first to ensure UMA always reports the correct group. | 97 // Query the field trial first to ensure UMA always reports the correct group. |
98 std::string group_name = | 98 std::string group_name = |
99 base::FieldTrialList::FindFullName("OfferUploadCreditCards"); | 99 base::FieldTrialList::FindFullName("OfferUploadCreditCards"); |
100 | 100 |
101 // Check Autofill sync setting. | 101 // Check Autofill sync setting. |
102 if (!(sync_service && sync_service->CanSyncStart() && | 102 if (!(sync_service && sync_service->CanSyncStart() && |
103 sync_service->GetPreferredDataTypes().Has(syncer::AUTOFILL_PROFILE))) { | 103 sync_service->GetPreferredDataTypes().Has(syncer::AUTOFILL_PROFILE))) { |
104 return false; | 104 return false; |
105 } | 105 } |
(...skipping 29 matching lines...) Expand all Loading... |
135 } | 135 } |
136 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 136 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
137 switches::kDisableOfferUploadCreditCards)) { | 137 switches::kDisableOfferUploadCreditCards)) { |
138 return false; | 138 return false; |
139 } | 139 } |
140 | 140 |
141 return !group_name.empty() && group_name != "Disabled"; | 141 return !group_name.empty() && group_name != "Disabled"; |
142 } | 142 } |
143 | 143 |
144 } // namespace autofill | 144 } // namespace autofill |
OLD | NEW |