Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 client_->ShowAutofillSettings(); | 245 client_->ShowAutofillSettings(); |
| 246 } | 246 } |
| 247 | 247 |
| 248 bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, | 248 bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, |
| 249 const FormFieldData& field) { | 249 const FormFieldData& field) { |
| 250 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 250 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 251 switches::kDisableCreditCardScan)) { | 251 switches::kDisableCreditCardScan)) { |
| 252 return false; | 252 return false; |
| 253 } | 253 } |
| 254 | 254 |
| 255 if (base::FieldTrialList::FindFullName("CreditCardScan") == "Control" && | |
|
Mathieu
2016/05/02 19:44:59
nit: do we still need to import base/metrics/..?
please use gerrit instead
2016/05/02 21:29:02
No longer needed.
| |
| 256 !base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 257 switches::kEnableCreditCardScan)) { | |
| 258 return false; | |
| 259 } | |
| 260 | |
| 261 if (!client_->HasCreditCardScanFeature()) | 255 if (!client_->HasCreditCardScanFeature()) |
| 262 return false; | 256 return false; |
| 263 | 257 |
| 264 AutofillField* autofill_field = GetAutofillField(form, field); | 258 AutofillField* autofill_field = GetAutofillField(form, field); |
| 265 if (!autofill_field || | 259 if (!autofill_field || |
| 266 autofill_field->Type().GetStorableType() != CREDIT_CARD_NUMBER) { | 260 autofill_field->Type().GetStorableType() != CREDIT_CARD_NUMBER) { |
| 267 return false; | 261 return false; |
| 268 } | 262 } |
| 269 | 263 |
| 270 static const int kShowScanCreditCardMaxValueLength = 6; | 264 static const int kShowScanCreditCardMaxValueLength = 6; |
| (...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2005 if (i > 0) | 1999 if (i > 0) |
| 2006 fputs("Next oldest form:\n", file); | 2000 fputs("Next oldest form:\n", file); |
| 2007 } | 2001 } |
| 2008 fputs("\n", file); | 2002 fputs("\n", file); |
| 2009 | 2003 |
| 2010 fclose(file); | 2004 fclose(file); |
| 2011 } | 2005 } |
| 2012 #endif // ENABLE_FORM_DEBUG_DUMP | 2006 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2013 | 2007 |
| 2014 } // namespace autofill | 2008 } // namespace autofill |
| OLD | NEW |