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

Side by Side Diff: third_party/WebKit/Source/web/WebFormControlElement.cpp

Issue 1473733008: [Autofill] Respect the autocomplete=off attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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
« no previous file with comments | « components/autofill/core/common/autofill_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 { 76 {
77 return constUnwrap<HTMLFormControlElement>()->nameForAutofill(); 77 return constUnwrap<HTMLFormControlElement>()->nameForAutofill();
78 } 78 }
79 79
80 bool WebFormControlElement::autoComplete() const 80 bool WebFormControlElement::autoComplete() const
81 { 81 {
82 if (isHTMLInputElement(*m_private)) 82 if (isHTMLInputElement(*m_private))
83 return constUnwrap<HTMLInputElement>()->shouldAutocomplete(); 83 return constUnwrap<HTMLInputElement>()->shouldAutocomplete();
84 if (isHTMLTextAreaElement(*m_private)) 84 if (isHTMLTextAreaElement(*m_private))
85 return constUnwrap<HTMLTextAreaElement>()->shouldAutocomplete(); 85 return constUnwrap<HTMLTextAreaElement>()->shouldAutocomplete();
86 if (isHTMLSelectElement(*m_private))
87 return constUnwrap<HTMLSelectElement>()->shouldAutocomplete();
86 return false; 88 return false;
87 } 89 }
88 90
89 void WebFormControlElement::setValue(const WebString& value, bool sendEvents) 91 void WebFormControlElement::setValue(const WebString& value, bool sendEvents)
90 { 92 {
91 if (isHTMLInputElement(*m_private)) 93 if (isHTMLInputElement(*m_private))
92 unwrap<HTMLInputElement>()->setValue(value, sendEvents ? DispatchInputAn dChangeEvent : DispatchNoEvent); 94 unwrap<HTMLInputElement>()->setValue(value, sendEvents ? DispatchInputAn dChangeEvent : DispatchNoEvent);
93 else if (isHTMLTextAreaElement(*m_private)) 95 else if (isHTMLTextAreaElement(*m_private))
94 unwrap<HTMLTextAreaElement>()->setValue(value, sendEvents ? DispatchInpu tAndChangeEvent : DispatchNoEvent); 96 unwrap<HTMLTextAreaElement>()->setValue(value, sendEvents ? DispatchInpu tAndChangeEvent : DispatchNoEvent);
95 else if (isHTMLSelectElement(*m_private)) 97 else if (isHTMLSelectElement(*m_private))
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 m_private = elem; 189 m_private = elem;
188 return *this; 190 return *this;
189 } 191 }
190 192
191 WebFormControlElement::operator PassRefPtrWillBeRawPtr<HTMLFormControlElement>() const 193 WebFormControlElement::operator PassRefPtrWillBeRawPtr<HTMLFormControlElement>() const
192 { 194 {
193 return toHTMLFormControlElement(m_private.get()); 195 return toHTMLFormControlElement(m_private.get());
194 } 196 }
195 197
196 } // namespace blink 198 } // namespace blink
OLDNEW
« no previous file with comments | « components/autofill/core/common/autofill_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698