OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef WEBKIT_GLUE_FORM_FIELD_H_ | 5 #ifndef WEBKIT_GLUE_FORM_FIELD_H_ |
6 #define WEBKIT_GLUE_FORM_FIELD_H_ | 6 #define WEBKIT_GLUE_FORM_FIELD_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 #include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h" |
12 | 12 |
13 namespace webkit_glue { | 13 namespace webkit_glue { |
14 | 14 |
15 // Stores information about a field in a form. | 15 // Stores information about a field in a form. |
16 class FormField { | 16 class FormField { |
17 public: | 17 public: |
18 FormField(); | 18 FormField(); |
19 explicit FormField(WebKit::WebFormControlElement element); | 19 explicit FormField(WebKit::WebFormControlElement element); |
20 FormField(const string16& label, | 20 FormField(const string16& label, |
21 const string16& name, | 21 const string16& name, |
22 const string16& value, | 22 const string16& value, |
23 const string16& form_control_type, | 23 const string16& form_control_type, |
24 int size); | 24 int size); |
25 ~FormField(); | |
tony
2010/08/27 20:24:48
Nit: In the case of a non-virtual empty destructor
jamesr
2010/08/27 20:28:44
If it's not explicitly declared then you get the c
Elliot Glaysher
2010/08/27 21:02:45
This is not an empty destructor. The destructor, e
darin (slow to review)
2010/08/27 21:28:35
Agreed. This is a good case to move into the .cc
| |
25 | 26 |
26 const string16& label() const { return label_; } | 27 const string16& label() const { return label_; } |
27 const string16& name() const { return name_; } | 28 const string16& name() const { return name_; } |
28 const string16& value() const { return value_; } | 29 const string16& value() const { return value_; } |
29 const string16& form_control_type() const { return form_control_type_; } | 30 const string16& form_control_type() const { return form_control_type_; } |
30 int size() const { return size_; } | 31 int size() const { return size_; } |
31 // Returns option string for elements for which they make sense (select-one, | 32 // Returns option string for elements for which they make sense (select-one, |
32 // for example) for the rest of elements return an empty array. | 33 // for example) for the rest of elements return an empty array. |
33 const std::vector<string16>& option_strings() const { | 34 const std::vector<string16>& option_strings() const { |
34 return option_strings_; | 35 return option_strings_; |
(...skipping 29 matching lines...) Expand all Loading... | |
64 int size_; | 65 int size_; |
65 std::vector<string16> option_strings_; | 66 std::vector<string16> option_strings_; |
66 }; | 67 }; |
67 | 68 |
68 // So we can compare FormFields with EXPECT_EQ(). | 69 // So we can compare FormFields with EXPECT_EQ(). |
69 std::ostream& operator<<(std::ostream& os, const FormField& profile); | 70 std::ostream& operator<<(std::ostream& os, const FormField& profile); |
70 | 71 |
71 } // namespace webkit_glue | 72 } // namespace webkit_glue |
72 | 73 |
73 #endif // WEBKIT_GLUE_FORM_FIELD_H_ | 74 #endif // WEBKIT_GLUE_FORM_FIELD_H_ |
OLD | NEW |