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

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

Issue 293993004: Replace WebElement::hasTagName with hasHTMLTagName in autofill (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | components/autofill/content/renderer/page_click_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 FILTER_DISABLED_ELEMENTS = 1 << 0, 60 FILTER_DISABLED_ELEMENTS = 1 << 0,
61 FILTER_READONLY_ELEMENTS = 1 << 1, 61 FILTER_READONLY_ELEMENTS = 1 << 1,
62 FILTER_NON_FOCUSABLE_ELEMENTS = 1 << 2, 62 FILTER_NON_FOCUSABLE_ELEMENTS = 1 << 2,
63 FILTER_ALL_NON_EDITIABLE_ELEMENTS = FILTER_DISABLED_ELEMENTS | 63 FILTER_ALL_NON_EDITIABLE_ELEMENTS = FILTER_DISABLED_ELEMENTS |
64 FILTER_READONLY_ELEMENTS | 64 FILTER_READONLY_ELEMENTS |
65 FILTER_NON_FOCUSABLE_ELEMENTS, 65 FILTER_NON_FOCUSABLE_ELEMENTS,
66 }; 66 };
67 67
68 bool IsOptionElement(const WebElement& element) { 68 bool IsOptionElement(const WebElement& element) {
69 CR_DEFINE_STATIC_LOCAL(WebString, kOption, ("option")); 69 CR_DEFINE_STATIC_LOCAL(WebString, kOption, ("option"));
70 return element.hasTagName(kOption); 70 return element.hasHTMLTagName(kOption);
71 } 71 }
72 72
73 bool IsScriptElement(const WebElement& element) { 73 bool IsScriptElement(const WebElement& element) {
74 CR_DEFINE_STATIC_LOCAL(WebString, kScript, ("script")); 74 CR_DEFINE_STATIC_LOCAL(WebString, kScript, ("script"));
75 return element.hasTagName(kScript); 75 return element.hasHTMLTagName(kScript);
76 } 76 }
77 77
78 bool IsNoScriptElement(const WebElement& element) { 78 bool IsNoScriptElement(const WebElement& element) {
79 CR_DEFINE_STATIC_LOCAL(WebString, kNoScript, ("noscript")); 79 CR_DEFINE_STATIC_LOCAL(WebString, kNoScript, ("noscript"));
80 return element.hasTagName(kNoScript); 80 return element.hasHTMLTagName(kNoScript);
81 } 81 }
82 82
83 bool HasTagName(const WebNode& node, const blink::WebString& tag) { 83 bool HasTagName(const WebNode& node, const blink::WebString& tag) {
84 return node.isElementNode() && node.toConst<WebElement>().hasHTMLTagName(tag); 84 return node.isElementNode() && node.toConst<WebElement>().hasHTMLTagName(tag);
85 } 85 }
86 86
87 bool IsAutofillableElement(const WebFormControlElement& element) { 87 bool IsAutofillableElement(const WebFormControlElement& element) {
88 const WebInputElement* input_element = toWebInputElement(&element); 88 const WebInputElement* input_element = toWebInputElement(&element);
89 return IsAutofillableInputElement(input_element) || 89 return IsAutofillableInputElement(input_element) ||
90 IsSelectElement(element) || 90 IsSelectElement(element) ||
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 1178
1179 gfx::RectF GetScaledBoundingBox(float scale, WebFormControlElement* element) { 1179 gfx::RectF GetScaledBoundingBox(float scale, WebFormControlElement* element) {
1180 gfx::Rect bounding_box(element->boundsInViewportSpace()); 1180 gfx::Rect bounding_box(element->boundsInViewportSpace());
1181 return gfx::RectF(bounding_box.x() * scale, 1181 return gfx::RectF(bounding_box.x() * scale,
1182 bounding_box.y() * scale, 1182 bounding_box.y() * scale,
1183 bounding_box.width() * scale, 1183 bounding_box.width() * scale,
1184 bounding_box.height() * scale); 1184 bounding_box.height() * scale);
1185 } 1185 }
1186 1186
1187 } // namespace autofill 1187 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/content/renderer/page_click_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698