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

Side by Side Diff: chrome/browser/autofill/autofill_field.cc

Issue 7980025: Ignore crowd-sourced fax number detection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autofill/autofill_field.h ('k') | chrome/browser/autofill/field_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/autofill/autofill_field.h" 5 #include "chrome/browser/autofill/autofill_field.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if (type >= 0 && type < MAX_VALID_FIELD_TYPE) { 46 if (type >= 0 && type < MAX_VALID_FIELD_TYPE) {
47 heuristic_type_ = type; 47 heuristic_type_ = type;
48 } else { 48 } else {
49 NOTREACHED(); 49 NOTREACHED();
50 // This case should not be reachable; but since this has potential 50 // This case should not be reachable; but since this has potential
51 // implications on data uploaded to the server, better safe than sorry. 51 // implications on data uploaded to the server, better safe than sorry.
52 heuristic_type_ = UNKNOWN_TYPE; 52 heuristic_type_ = UNKNOWN_TYPE;
53 } 53 }
54 } 54 }
55 55
56 void AutofillField::set_server_type(AutofillFieldType type) {
57 // Chrome no longer supports fax numbers, but the server still does.
58 if (type >= PHONE_FAX_NUMBER && type <= PHONE_FAX_WHOLE_NUMBER)
59 return;
60
61 server_type_ = type;
62 }
63
56 AutofillFieldType AutofillField::type() const { 64 AutofillFieldType AutofillField::type() const {
57 if (server_type_ != NO_SERVER_DATA) 65 if (server_type_ != NO_SERVER_DATA)
58 return server_type_; 66 return server_type_;
59 67
60 return heuristic_type_; 68 return heuristic_type_;
61 } 69 }
62 70
63 bool AutofillField::IsEmpty() const { 71 bool AutofillField::IsEmpty() const {
64 return value.empty(); 72 return value.empty();
65 } 73 }
66 74
67 std::string AutofillField::FieldSignature() const { 75 std::string AutofillField::FieldSignature() const {
68 std::string field_name = UTF16ToUTF8(name); 76 std::string field_name = UTF16ToUTF8(name);
69 std::string type = UTF16ToUTF8(form_control_type); 77 std::string type = UTF16ToUTF8(form_control_type);
70 std::string field_string = field_name + "&" + type; 78 std::string field_string = field_name + "&" + type;
71 return Hash32Bit(field_string); 79 return Hash32Bit(field_string);
72 } 80 }
73 81
74 bool AutofillField::IsFieldFillable() const { 82 bool AutofillField::IsFieldFillable() const {
75 return type() != UNKNOWN_TYPE; 83 return type() != UNKNOWN_TYPE;
76 } 84 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_field.h ('k') | chrome/browser/autofill/field_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698