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

Unified Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 376133004: [Refactor] Use isEmailField() for input element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits fixed 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/autofill_agent.cc
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index bfd57318c9f13d512fb7bd52fe1c9eeebd51e093..6f6959b77feb8f53ef873628fec8a8800f705bb2 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -80,8 +80,7 @@ void GetDataListSuggestions(const WebInputElement& element,
base::string16 prefix;
if (!ignore_current_value) {
prefix = element.editingValue();
- if (element.isMultiple() &&
- element.formControlType() == WebString::fromUTF8("email")) {
+ if (element.isMultiple() && element.isEmailField()) {
std::vector<base::string16> parts;
base::SplitStringDontTrim(prefix, ',', &parts);
if (parts.size() > 0) {
@@ -414,8 +413,7 @@ void AutofillAgent::AcceptDataListSuggestion(
base::string16 new_value = suggested_value;
// If this element takes multiple values then replace the last part with
// the suggestion.
- if (input_element->isMultiple() &&
- input_element->formControlType() == WebString::fromUTF8("email")) {
+ if (input_element->isMultiple() && input_element->isEmailField()) {
std::vector<base::string16> parts;
base::SplitStringDontTrim(input_element->editingValue(), ',', &parts);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698