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

Side by Side Diff: webkit/forms/form_field.cc

Issue 11000016: Move forms/ out of webkit/. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Response to review Created 8 years, 2 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 | « webkit/forms/form_field.h ('k') | webkit/forms/form_field_predictions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "webkit/forms/form_field.h"
6
7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h"
9
10 namespace webkit {
11 namespace forms {
12
13 FormField::FormField()
14 : max_length(0),
15 is_autofilled(false),
16 is_focusable(false),
17 should_autocomplete(false) {
18 }
19
20 FormField::~FormField() {
21 }
22
23 bool FormField::operator==(const FormField& field) const {
24 // A FormField stores a value, but the value is not part of the identity of
25 // the field, so we don't want to compare the values.
26 return (label == field.label &&
27 name == field.name &&
28 form_control_type == field.form_control_type &&
29 autocomplete_type == field.autocomplete_type &&
30 max_length == field.max_length);
31 }
32
33 bool FormField::operator!=(const FormField& field) const {
34 return !operator==(field);
35 }
36
37 bool FormField::operator<(const FormField& field) const {
38 if (label == field.label)
39 return name < field.name;
40
41 return label < field.label;
42 }
43
44 std::ostream& operator<<(std::ostream& os, const FormField& field) {
45 return os
46 << UTF16ToUTF8(field.label)
47 << " "
48 << UTF16ToUTF8(field.name)
49 << " "
50 << UTF16ToUTF8(field.value)
51 << " "
52 << UTF16ToUTF8(field.form_control_type)
53 << " "
54 << UTF16ToUTF8(field.autocomplete_type)
55 << " "
56 << field.max_length
57 << " "
58 << (field.is_autofilled ? "true" : "false")
59 << " "
60 << (field.is_focusable ? "true" : "false")
61 << " "
62 << (field.should_autocomplete ? "true" : "false");
63 }
64
65 } // namespace forms
66 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/forms/form_field.h ('k') | webkit/forms/form_field_predictions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698