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

Side by Side Diff: chrome/browser/autofill/form_structure.cc

Issue 3251007: Revert 53686 - Merge 53350 - AutoFill: Record whether the user initiated the ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 3 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/autofill/form_structure.h" 5 #include "chrome/browser/autofill/form_structure.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/sha1.h" 9 #include "base/sha1.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 size_t field_size = fields_.size(); 322 size_t field_size = fields_.size();
323 return (field_size == 0) ? 0 : field_size - 1; 323 return (field_size == 0) ? 0 : field_size - 1;
324 } 324 }
325 325
326 FormData FormStructure::ConvertToFormData() const { 326 FormData FormStructure::ConvertToFormData() const {
327 FormData form; 327 FormData form;
328 form.name = form_name_; 328 form.name = form_name_;
329 form.origin = source_url_; 329 form.origin = source_url_;
330 form.action = target_url_; 330 form.action = target_url_;
331 331
332 // FormStructures can't be created by forms not submitted by the user.
333 form.user_submitted = true;
334
335 if (method_ == GET) 332 if (method_ == GET)
336 form.method = ASCIIToUTF16("GET"); 333 form.method = ASCIIToUTF16("GET");
337 else if (method_ == POST) 334 else if (method_ == POST)
338 form.method = ASCIIToUTF16("POST"); 335 form.method = ASCIIToUTF16("POST");
339 else 336 else
340 NOTREACHED(); 337 NOTREACHED();
341 338
342 for (std::vector<AutoFillField*>::const_iterator iter = fields_.begin(); 339 for (std::vector<AutoFillField*>::const_iterator iter = fields_.begin();
343 iter != fields_.end() && *iter; ++iter) { 340 iter != fields_.end() && *iter; ++iter) {
344 form.fields.push_back(static_cast<webkit_glue::FormField>(**iter)); 341 form.fields.push_back(static_cast<webkit_glue::FormField>(**iter));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } else { 428 } else {
432 buzz::XmlElement *field_element = new buzz::XmlElement( 429 buzz::XmlElement *field_element = new buzz::XmlElement(
433 buzz::QName(kXMLElementField)); 430 buzz::QName(kXMLElementField));
434 field_element->SetAttr(buzz::QName(kAttributeSignature), 431 field_element->SetAttr(buzz::QName(kAttributeSignature),
435 field->FieldSignature()); 432 field->FieldSignature());
436 encompassing_xml_element->AddElement(field_element); 433 encompassing_xml_element->AddElement(field_element);
437 } 434 }
438 } 435 }
439 return true; 436 return true;
440 } 437 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | chrome/browser/autofill/form_structure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698