| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
| 10 #include "AnimationController.h" | 10 #include "AnimationController.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 changed.push_back(ie); | 229 changed.push_back(ie); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 // Call all the onChange functions. | 235 // Call all the onChange functions. |
| 236 std::vector<WebCore::HTMLInputElement*>::iterator changed_ie; | 236 std::vector<WebCore::HTMLInputElement*>::iterator changed_ie; |
| 237 for (changed_ie = changed.begin(); changed_ie != changed.end(); | 237 for (changed_ie = changed.begin(); changed_ie != changed.end(); |
| 238 ++changed_ie) { | 238 ++changed_ie) { |
| 239 (*changed_ie)->onChange(); | 239 (*changed_ie)->dispatchFormControlChangeEvent(); |
| 240 (*changed_ie)->deref(); | 240 (*changed_ie)->deref(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 // If we found both the file and the submit button, let's submit. | 243 // If we found both the file and the submit button, let's submit. |
| 244 if (file_found && submit_found) { | 244 if (file_found && submit_found) { |
| 245 fe->submit(0, false, false); | 245 fe->submit(0, false, false); |
| 246 } | 246 } |
| 247 | 247 |
| 248 fe->deref(); | 248 fe->deref(); |
| 249 | 249 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 it != fe->input_elements.end(); ++it) { | 295 it != fe->input_elements.end(); ++it) { |
| 296 if (it->first == data.submit) { | 296 if (it->first == data.submit) { |
| 297 it->second->setActivatedSubmit(true); | 297 it->second->setActivatedSubmit(true); |
| 298 submit_found = true; | 298 submit_found = true; |
| 299 continue; | 299 continue; |
| 300 } | 300 } |
| 301 if (!it->second->value().isEmpty()) // Don't overwrite pre-filled values. | 301 if (!it->second->value().isEmpty()) // Don't overwrite pre-filled values. |
| 302 continue; | 302 continue; |
| 303 it->second->setValue(StdWStringToString(data_map[it->first])); | 303 it->second->setValue(StdWStringToString(data_map[it->first])); |
| 304 it->second->setAutofilled(true); | 304 it->second->setAutofilled(true); |
| 305 it->second->onChange(); | 305 it->second->dispatchFormControlChangeEvent(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 if (submit && submit_found) { | 308 if (submit && submit_found) { |
| 309 fe->form_element->submit(); | 309 fe->form_element->submit(); |
| 310 return true; | 310 return true; |
| 311 } | 311 } |
| 312 return false; | 312 return false; |
| 313 } | 313 } |
| 314 | 314 |
| 315 // Helper to search the given form element for the specified input elements | 315 // Helper to search the given form element for the specified input elements |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 return static_cast<WebCore::HTMLInputElement*>(element); | 874 return static_cast<WebCore::HTMLInputElement*>(element); |
| 875 } | 875 } |
| 876 | 876 |
| 877 WebCore::HTMLInputElement* NodeToHTMLInputElement(WebCore::Node* node) { | 877 WebCore::HTMLInputElement* NodeToHTMLInputElement(WebCore::Node* node) { |
| 878 if (node->nodeType() != WebCore::Node::ELEMENT_NODE) | 878 if (node->nodeType() != WebCore::Node::ELEMENT_NODE) |
| 879 return NULL; | 879 return NULL; |
| 880 return ElementToHTMLInputElement(static_cast<WebCore::Element*>(node)); | 880 return ElementToHTMLInputElement(static_cast<WebCore::Element*>(node)); |
| 881 } | 881 } |
| 882 | 882 |
| 883 } // webkit_glue | 883 } // webkit_glue |
| OLD | NEW |