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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
668 | 668 |
669 return element->isCheckbox() || element->isRadioButton(); | 669 return element->isCheckbox() || element->isRadioButton(); |
670 } | 670 } |
671 | 671 |
672 bool IsAutofillableInputElement(const WebInputElement* element) { | 672 bool IsAutofillableInputElement(const WebInputElement* element) { |
673 return IsTextInput(element) || | 673 return IsTextInput(element) || |
674 IsMonthInput(element) || | 674 IsMonthInput(element) || |
675 IsCheckableElement(element); | 675 IsCheckableElement(element); |
676 } | 676 } |
677 | 677 |
678 const base::string16 GetFormIdentifier(const WebFormElement& form) { | 678 const base::string16& GetFormIdentifier(const WebFormElement& form) { |
vabr (Chromium)
2014/07/11 13:37:43
Here returning a reference won't work, because the
Ilya Sherman
2014/07/11 19:11:10
As I mentioned on the bug, the const here is corre
vabr (Chromium)
2014/07/11 19:24:47
Thanks for pointing that out.
Let's revert the cha
lucinka.brozkova
2014/07/11 21:05:57
Done.
| |
679 base::string16 identifier = form.name(); | 679 base::string16 identifier = form.name(); |
680 CR_DEFINE_STATIC_LOCAL(WebString, kId, ("id")); | 680 CR_DEFINE_STATIC_LOCAL(WebString, kId, ("id")); |
681 if (identifier.empty()) | 681 if (identifier.empty()) |
682 identifier = form.getAttribute(kId); | 682 identifier = form.getAttribute(kId); |
683 | 683 |
684 return identifier; | 684 return identifier; |
685 } | 685 } |
686 | 686 |
687 bool IsWebNodeVisible(const blink::WebNode& node) { | 687 bool IsWebNodeVisible(const blink::WebNode& node) { |
688 // In the bug http://crbug.com/237216 the form's bounding box is empty | 688 // In the bug http://crbug.com/237216 the form's bounding box is empty |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1182 | 1182 |
1183 gfx::RectF GetScaledBoundingBox(float scale, WebFormControlElement* element) { | 1183 gfx::RectF GetScaledBoundingBox(float scale, WebFormControlElement* element) { |
1184 gfx::Rect bounding_box(element->boundsInViewportSpace()); | 1184 gfx::Rect bounding_box(element->boundsInViewportSpace()); |
1185 return gfx::RectF(bounding_box.x() * scale, | 1185 return gfx::RectF(bounding_box.x() * scale, |
1186 bounding_box.y() * scale, | 1186 bounding_box.y() * scale, |
1187 bounding_box.width() * scale, | 1187 bounding_box.width() * scale, |
1188 bounding_box.height() * scale); | 1188 bounding_box.height() * scale); |
1189 } | 1189 } |
1190 | 1190 |
1191 } // namespace autofill | 1191 } // namespace autofill |
OLD | NEW |