OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/renderer/form_autofill_util.h" | 5 #include "components/autofill/content/renderer/form_autofill_util.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 CR_DEFINE_STATIC_LOCAL(WebString, kHidden, ("hidden")); | 845 CR_DEFINE_STATIC_LOCAL(WebString, kHidden, ("hidden")); |
846 | 846 |
847 const WebFrame* frame = form_element.document().frame(); | 847 const WebFrame* frame = form_element.document().frame(); |
848 if (!frame) | 848 if (!frame) |
849 return false; | 849 return false; |
850 | 850 |
851 if (requirements & REQUIRE_AUTOCOMPLETE && !form_element.autoComplete()) | 851 if (requirements & REQUIRE_AUTOCOMPLETE && !form_element.autoComplete()) |
852 return false; | 852 return false; |
853 | 853 |
854 form->name = GetFormIdentifier(form_element); | 854 form->name = GetFormIdentifier(form_element); |
855 form->method = form_element.method(); | |
856 form->origin = frame->document().url(); | 855 form->origin = frame->document().url(); |
857 form->action = frame->document().completeURL(form_element.action()); | 856 form->action = frame->document().completeURL(form_element.action()); |
858 form->user_submitted = form_element.wasUserSubmitted(); | 857 form->user_submitted = form_element.wasUserSubmitted(); |
859 | 858 |
860 // If the completed URL is not valid, just use the action we get from | 859 // If the completed URL is not valid, just use the action we get from |
861 // WebKit. | 860 // WebKit. |
862 if (!form->action.is_valid()) | 861 if (!form->action.is_valid()) |
863 form->action = GURL(form_element.action()); | 862 form->action = GURL(form_element.action()); |
864 | 863 |
865 // A map from a FormFieldData's name to the FormFieldData itself. | 864 // A map from a FormFieldData's name to the FormFieldData itself. |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 | 1181 |
1183 gfx::RectF GetScaledBoundingBox(float scale, WebFormControlElement* element) { | 1182 gfx::RectF GetScaledBoundingBox(float scale, WebFormControlElement* element) { |
1184 gfx::Rect bounding_box(element->boundsInViewportSpace()); | 1183 gfx::Rect bounding_box(element->boundsInViewportSpace()); |
1185 return gfx::RectF(bounding_box.x() * scale, | 1184 return gfx::RectF(bounding_box.x() * scale, |
1186 bounding_box.y() * scale, | 1185 bounding_box.y() * scale, |
1187 bounding_box.width() * scale, | 1186 bounding_box.width() * scale, |
1188 bounding_box.height() * scale); | 1187 bounding_box.height() * scale); |
1189 } | 1188 } |
1190 | 1189 |
1191 } // namespace autofill | 1190 } // namespace autofill |
OLD | NEW |