| 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/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 IDS_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE_LABEL_AND_ABBR); | 139 IDS_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE_LABEL_AND_ABBR); |
| 140 if (!format_string.empty()) { | 140 if (!format_string.empty()) { |
| 141 suggestion->value.append(l10n_util::GetStringFUTF16( | 141 suggestion->value.append(l10n_util::GetStringFUTF16( |
| 142 IDS_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE_LABEL_AND_ABBR, | 142 IDS_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE_LABEL_AND_ABBR, |
| 143 suggestion->label)); | 143 suggestion->label)); |
| 144 } | 144 } |
| 145 suggestion->label.clear(); | 145 suggestion->label.clear(); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 unsigned int GetPopupMargin() { |
| 150 return GetCreditCardPopupParameterUintValue(kAutofillPopupMarginKey); |
| 151 } |
| 152 |
| 149 bool OfferStoreUnmaskedCards() { | 153 bool OfferStoreUnmaskedCards() { |
| 150 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 154 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 151 // The checkbox can be forced on with a flag, but by default we don't store | 155 // The checkbox can be forced on with a flag, but by default we don't store |
| 152 // on Linux due to lack of system keychain integration. See crbug.com/162735 | 156 // on Linux due to lack of system keychain integration. See crbug.com/162735 |
| 153 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 157 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 154 switches::kEnableOfferStoreUnmaskedWalletCards); | 158 switches::kEnableOfferStoreUnmaskedWalletCards); |
| 155 #else | 159 #else |
| 156 // Query the field trial before checking command line flags to ensure UMA | 160 // Query the field trial before checking command line flags to ensure UMA |
| 157 // reports the correct group. | 161 // reports the correct group. |
| 158 std::string group_name = | 162 std::string group_name = |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 } | 219 } |
| 216 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 220 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 217 switches::kDisableOfferUploadCreditCards)) { | 221 switches::kDisableOfferUploadCreditCards)) { |
| 218 return false; | 222 return false; |
| 219 } | 223 } |
| 220 | 224 |
| 221 return !group_name.empty() && group_name != "Disabled"; | 225 return !group_name.empty() && group_name != "Disabled"; |
| 222 } | 226 } |
| 223 | 227 |
| 224 } // namespace autofill | 228 } // namespace autofill |
| OLD | NEW |