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

Side by Side Diff: Source/web/WebInputElement.cpp

Issue 194923003: Move common methods to WebFormControlElement interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « Source/web/WebFormControlElement.cpp ('k') | Source/web/WebSelectElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool WebInputElement::isRadioButton() const 70 bool WebInputElement::isRadioButton() const
71 { 71 {
72 return constUnwrap<HTMLInputElement>()->isRadioButton(); 72 return constUnwrap<HTMLInputElement>()->isRadioButton();
73 } 73 }
74 74
75 bool WebInputElement::isCheckbox() const 75 bool WebInputElement::isCheckbox() const
76 { 76 {
77 return constUnwrap<HTMLInputElement>()->isCheckbox(); 77 return constUnwrap<HTMLInputElement>()->isCheckbox();
78 } 78 }
79 79
80 bool WebInputElement::autoComplete() const
81 {
82 return constUnwrap<HTMLInputElement>()->shouldAutocomplete();
83 }
84
85 int WebInputElement::maxLength() const 80 int WebInputElement::maxLength() const
86 { 81 {
87 return constUnwrap<HTMLInputElement>()->maxLength(); 82 return constUnwrap<HTMLInputElement>()->maxLength();
88 } 83 }
89 84
90 bool WebInputElement::isActivatedSubmit() const 85 bool WebInputElement::isActivatedSubmit() const
91 { 86 {
92 return constUnwrap<HTMLInputElement>()->isActivatedSubmit(); 87 return constUnwrap<HTMLInputElement>()->isActivatedSubmit();
93 } 88 }
94 89
95 void WebInputElement::setActivatedSubmit(bool activated) 90 void WebInputElement::setActivatedSubmit(bool activated)
96 { 91 {
97 unwrap<HTMLInputElement>()->setActivatedSubmit(activated); 92 unwrap<HTMLInputElement>()->setActivatedSubmit(activated);
98 } 93 }
99 94
100 int WebInputElement::size() const 95 int WebInputElement::size() const
101 { 96 {
102 return constUnwrap<HTMLInputElement>()->size(); 97 return constUnwrap<HTMLInputElement>()->size();
103 } 98 }
104 99
105 void WebInputElement::setValue(const WebString& value, bool sendChangeEvent)
106 {
107 unwrap<HTMLInputElement>()->setValue(value, sendChangeEvent ? DispatchChange Event : DispatchNoEvent);
108 }
109
110 WebString WebInputElement::value() const
111 {
112 return constUnwrap<HTMLInputElement>()->value();
113 }
114
115 void WebInputElement::setEditingValue(const WebString& value) 100 void WebInputElement::setEditingValue(const WebString& value)
116 { 101 {
117 unwrap<HTMLInputElement>()->setEditingValue(value); 102 unwrap<HTMLInputElement>()->setEditingValue(value);
118 } 103 }
119 104
120 void WebInputElement::setSuggestedValue(const WebString& value)
121 {
122 unwrap<HTMLInputElement>()->setSuggestedValue(value);
123 }
124
125 WebString WebInputElement::suggestedValue() const
126 {
127 return constUnwrap<HTMLInputElement>()->suggestedValue();
128 }
129
130 void WebInputElement::setSelectionRange(int start, int end)
131 {
132 unwrap<HTMLInputElement>()->setSelectionRange(start, end);
133 }
134
135 bool WebInputElement::isValidValue(const WebString& value) const 105 bool WebInputElement::isValidValue(const WebString& value) const
136 { 106 {
137 return constUnwrap<HTMLInputElement>()->isValidValue(value); 107 return constUnwrap<HTMLInputElement>()->isValidValue(value);
138 } 108 }
139 109
140 void WebInputElement::setChecked(bool nowChecked, bool sendChangeEvent) 110 void WebInputElement::setChecked(bool nowChecked, bool sendChangeEvent)
141 { 111 {
142 unwrap<HTMLInputElement>()->setChecked(nowChecked, sendChangeEvent ? Dispatc hChangeEvent : DispatchNoEvent); 112 unwrap<HTMLInputElement>()->setChecked(nowChecked, sendChangeEvent ? Dispatc hChangeEvent : DispatchNoEvent);
143 } 113 }
144 114
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 if (InputFieldSpeechButtonElement* speechButton = speechButtonElement(this)) 174 if (InputFieldSpeechButtonElement* speechButton = speechButtonElement(this))
205 speechButton->stopSpeechInput(); 175 speechButton->stopSpeechInput();
206 #endif 176 #endif
207 } 177 }
208 178
209 int WebInputElement::defaultMaxLength() 179 int WebInputElement::defaultMaxLength()
210 { 180 {
211 return HTMLInputElement::maximumLength; 181 return HTMLInputElement::maximumLength;
212 } 182 }
213 183
214 WebString WebInputElement::directionForFormData() const
215 {
216 return constUnwrap<HTMLInputElement>()->directionForFormData();
217 }
218
219 // FIXME: Remove this once password_generation_manager.h stops using it. 184 // FIXME: Remove this once password_generation_manager.h stops using it.
220 WebElement WebInputElement::decorationElementFor(void*) 185 WebElement WebInputElement::decorationElementFor(void*)
221 { 186 {
222 return passwordGeneratorButtonElement(); 187 return passwordGeneratorButtonElement();
223 } 188 }
224 189
225 WebElement WebInputElement::passwordGeneratorButtonElement() const 190 WebElement WebInputElement::passwordGeneratorButtonElement() const
226 { 191 {
227 return WebElement(constUnwrap<HTMLInputElement>()->passwordGeneratorButtonEl ement()); 192 return WebElement(constUnwrap<HTMLInputElement>()->passwordGeneratorButtonEl ement());
228 } 193 }
(...skipping 20 matching lines...) Expand all
249 } 214 }
250 215
251 WebInputElement* toWebInputElement(WebElement* webElement) 216 WebInputElement* toWebInputElement(WebElement* webElement)
252 { 217 {
253 if (!webElement->unwrap<Element>()->hasTagName(HTMLNames::inputTag)) 218 if (!webElement->unwrap<Element>()->hasTagName(HTMLNames::inputTag))
254 return 0; 219 return 0;
255 220
256 return static_cast<WebInputElement*>(webElement); 221 return static_cast<WebInputElement*>(webElement);
257 } 222 }
258 } // namespace blink 223 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebFormControlElement.cpp ('k') | Source/web/WebSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698