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

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

Issue 140093005: Add supports that allow Autofill to be initiated from textarea field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Condition wrap correction Created 6 years, 9 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_cache.h" 5 #include "components/autofill/content/renderer/form_cache.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "components/autofill/content/renderer/form_autofill_util.h" 9 #include "components/autofill/content/renderer/form_autofill_util.h"
10 #include "components/autofill/core/common/autofill_constants.h" 10 #include "components/autofill/core/common/autofill_constants.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 for (std::vector<WebDocument>::const_iterator it = 172 for (std::vector<WebDocument>::const_iterator it =
173 documents_to_delete.begin(); 173 documents_to_delete.begin();
174 it != documents_to_delete.end(); ++it) { 174 it != documents_to_delete.end(); ++it) {
175 web_documents_.erase(*it); 175 web_documents_.erase(*it);
176 } 176 }
177 177
178 RemoveOldElements(frame, &initial_select_values_); 178 RemoveOldElements(frame, &initial_select_values_);
179 RemoveOldElements(frame, &initial_checked_state_); 179 RemoveOldElements(frame, &initial_checked_state_);
180 } 180 }
181 181
182 bool FormCache::ClearFormWithElement(const WebInputElement& element) { 182 bool FormCache::ClearFormWithElement(const WebFormControlElement& element) {
183 WebFormElement form_element = element.form(); 183 WebFormElement form_element = element.form();
184 if (form_element.isNull()) 184 if (form_element.isNull())
185 return false; 185 return false;
186 186
187 std::vector<WebFormControlElement> control_elements; 187 std::vector<WebFormControlElement> control_elements;
188 ExtractAutofillableElements(form_element, autofill::REQUIRE_NONE, 188 ExtractAutofillableElements(form_element, autofill::REQUIRE_NONE,
189 &control_elements); 189 &control_elements);
190 for (size_t i = 0; i < control_elements.size(); ++i) { 190 for (size_t i = 0; i < control_elements.size(); ++i) {
191 WebFormControlElement control_element = control_elements[i]; 191 WebFormControlElement control_element = control_elements[i];
192 // Don't modify the value of disabled fields. 192 // Don't modify the value of disabled fields.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 element->setAttribute("placeholder", 299 element->setAttribute("placeholder",
300 WebString(base::UTF8ToUTF16(placeholder))); 300 WebString(base::UTF8ToUTF16(placeholder)));
301 } 301 }
302 element->setAttribute("title", WebString(title)); 302 element->setAttribute("title", WebString(title));
303 } 303 }
304 304
305 return true; 305 return true;
306 } 306 }
307 307
308 } // namespace autofill 308 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698