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

Side by Side Diff: components/autofill/content/renderer/form_autofill_util.cc

Issue 382243002: Cleanup return values in autofill (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698