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

Side by Side Diff: components/autofill/core/common/form_data.cc

Issue 265203002: Revert of [Autofill] Enable Autofill for dynamically created forms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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/common/form_data.h" 5 #include "components/autofill/core/common/form_data.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/autofill/core/common/form_field_data.h" 10 #include "components/autofill/core/common/form_field_data.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 origin == form.origin && 72 origin == form.origin &&
73 action == form.action && 73 action == form.action &&
74 user_submitted == form.user_submitted && 74 user_submitted == form.user_submitted &&
75 fields == form.fields; 75 fields == form.fields;
76 } 76 }
77 77
78 bool FormData::operator!=(const FormData& form) const { 78 bool FormData::operator!=(const FormData& form) const {
79 return !operator==(form); 79 return !operator==(form);
80 } 80 }
81 81
82 bool FormData::operator<(const FormData& form) const {
83 if (name != form.name)
84 return name < form.name;
85 if (StringToLowerASCII(method) != StringToLowerASCII(form.method))
86 return StringToLowerASCII(method) < StringToLowerASCII(form.method);
87 if (origin != form.origin)
88 return origin < form.origin;
89 if (action != form.action)
90 return action < form.action;
91 if (user_submitted != form.user_submitted)
92 return user_submitted < form.user_submitted;
93 return fields < form.fields;
94 }
95
96 std::ostream& operator<<(std::ostream& os, const FormData& form) { 82 std::ostream& operator<<(std::ostream& os, const FormData& form) {
97 os << base::UTF16ToUTF8(form.name) << " " 83 os << base::UTF16ToUTF8(form.name) << " "
98 << base::UTF16ToUTF8(form.method) << " " 84 << base::UTF16ToUTF8(form.method) << " "
99 << form.origin << " " 85 << form.origin << " "
100 << form.action << " " 86 << form.action << " "
101 << form.user_submitted << " " 87 << form.user_submitted << " "
102 << "Fields:"; 88 << "Fields:";
103 for (size_t i = 0; i < form.fields.size(); ++i) { 89 for (size_t i = 0; i < form.fields.size(); ++i) {
104 os << form.fields[i] << ","; 90 os << form.fields[i] << ",";
105 } 91 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 124 }
139 default: { 125 default: {
140 LOG(ERROR) << "Unknown FormData pickle version " << version; 126 LOG(ERROR) << "Unknown FormData pickle version " << version;
141 return false; 127 return false;
142 } 128 }
143 } 129 }
144 return true; 130 return true;
145 } 131 }
146 132
147 } // namespace autofill 133 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/common/form_data.h ('k') | components/autofill/core/common/forms_seen_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698