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 #include "chrome/renderer/form_manager.h" | 5 #include "chrome/renderer/form_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/scoped_vector.h" | 8 #include "base/scoped_vector.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| 11 #include "base/utf_string_conversions.h" |
11 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" |
12 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" |
13 #include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h" |
14 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
15 #include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h" | 16 #include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h" |
16 #include "third_party/WebKit/WebKit/chromium/public/WebLabelElement.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebLabelElement.h" |
17 #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" | 18 #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" |
18 #include "third_party/WebKit/WebKit/chromium/public/WebNodeList.h" | 19 #include "third_party/WebKit/WebKit/chromium/public/WebNodeList.h" |
19 #include "third_party/WebKit/WebKit/chromium/public/WebOptionElement.h" | 20 #include "third_party/WebKit/WebKit/chromium/public/WebOptionElement.h" |
20 #include "third_party/WebKit/WebKit/chromium/public/WebSelectElement.h" | 21 #include "third_party/WebKit/WebKit/chromium/public/WebSelectElement.h" |
(...skipping 872 matching lines...) Loading... |
893 return; | 894 return; |
894 | 895 |
895 WebInputElement input_element = field->to<WebInputElement>(); | 896 WebInputElement input_element = field->to<WebInputElement>(); |
896 | 897 |
897 // If the maxlength attribute contains a negative value, maxLength() | 898 // If the maxlength attribute contains a negative value, maxLength() |
898 // returns the default maxlength value. | 899 // returns the default maxlength value. |
899 input_element.setSuggestedValue( | 900 input_element.setSuggestedValue( |
900 data->value().substr(0, input_element.maxLength())); | 901 data->value().substr(0, input_element.maxLength())); |
901 input_element.setAutofilled(true); | 902 input_element.setAutofilled(true); |
902 } | 903 } |
OLD | NEW |