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

Side by Side Diff: components/autofill/core/browser/autofill_manager.cc

Issue 1939183003: Enable credit card scanning by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused include 2 Created 4 years, 7 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 #include <limits> 11 #include <limits>
12 #include <map> 12 #include <map>
13 #include <set> 13 #include <set>
14 #include <utility> 14 #include <utility>
15 15
16 #include "base/bind.h" 16 #include "base/bind.h"
17 #include "base/command_line.h" 17 #include "base/command_line.h"
18 #include "base/containers/adapters.h" 18 #include "base/containers/adapters.h"
19 #include "base/files/file_util.h" 19 #include "base/files/file_util.h"
20 #include "base/guid.h" 20 #include "base/guid.h"
21 #include "base/logging.h" 21 #include "base/logging.h"
22 #include "base/message_loop/message_loop.h" 22 #include "base/message_loop/message_loop.h"
23 #include "base/metrics/field_trial.h"
24 #include "base/metrics/histogram_macros.h"
25 #include "base/path_service.h" 23 #include "base/path_service.h"
26 #include "base/strings/string16.h" 24 #include "base/strings/string16.h"
27 #include "base/strings/string_number_conversions.h" 25 #include "base/strings/string_number_conversions.h"
28 #include "base/strings/string_split.h" 26 #include "base/strings/string_split.h"
29 #include "base/strings/string_util.h" 27 #include "base/strings/string_util.h"
30 #include "base/strings/utf_string_conversions.h" 28 #include "base/strings/utf_string_conversions.h"
31 #include "base/threading/sequenced_worker_pool.h" 29 #include "base/threading/sequenced_worker_pool.h"
32 #include "base/threading/thread_restrictions.h" 30 #include "base/threading/thread_restrictions.h"
33 #include "build/build_config.h" 31 #include "build/build_config.h"
34 #include "components/autofill/core/browser/autocomplete_history_manager.h" 32 #include "components/autofill/core/browser/autocomplete_history_manager.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 client_->ShowAutofillSettings(); 243 client_->ShowAutofillSettings();
246 } 244 }
247 245
248 bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, 246 bool AutofillManager::ShouldShowScanCreditCard(const FormData& form,
249 const FormFieldData& field) { 247 const FormFieldData& field) {
250 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 248 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
251 switches::kDisableCreditCardScan)) { 249 switches::kDisableCreditCardScan)) {
252 return false; 250 return false;
253 } 251 }
254 252
255 if (base::FieldTrialList::FindFullName("CreditCardScan") == "Control" &&
256 !base::CommandLine::ForCurrentProcess()->HasSwitch(
257 switches::kEnableCreditCardScan)) {
258 return false;
259 }
260
261 if (!client_->HasCreditCardScanFeature()) 253 if (!client_->HasCreditCardScanFeature())
262 return false; 254 return false;
263 255
264 AutofillField* autofill_field = GetAutofillField(form, field); 256 AutofillField* autofill_field = GetAutofillField(form, field);
265 if (!autofill_field || 257 if (!autofill_field ||
266 autofill_field->Type().GetStorableType() != CREDIT_CARD_NUMBER) { 258 autofill_field->Type().GetStorableType() != CREDIT_CARD_NUMBER) {
267 return false; 259 return false;
268 } 260 }
269 261
270 static const int kShowScanCreditCardMaxValueLength = 6; 262 static const int kShowScanCreditCardMaxValueLength = 6;
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 if (i > 0) 1997 if (i > 0)
2006 fputs("Next oldest form:\n", file); 1998 fputs("Next oldest form:\n", file);
2007 } 1999 }
2008 fputs("\n", file); 2000 fputs("\n", file);
2009 2001
2010 fclose(file); 2002 fclose(file);
2011 } 2003 }
2012 #endif // ENABLE_FORM_DEBUG_DUMP 2004 #endif // ENABLE_FORM_DEBUG_DUMP
2013 2005
2014 } // namespace autofill 2006 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698