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

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

Issue 3226001: Detecting form locale (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Unit test for top websites 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
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_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 return base::Uint64ToString(hash64); 55 return base::Uint64ToString(hash64);
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 FormStructure::FormStructure(const FormData& form) 60 FormStructure::FormStructure(const FormData& form)
61 : form_name_(form.name), 61 : form_name_(form.name),
62 source_url_(form.origin), 62 source_url_(form.origin),
63 target_url_(form.action), 63 target_url_(form.action),
64 locale_(form.locale),
64 has_credit_card_field_(false), 65 has_credit_card_field_(false),
65 has_autofillable_field_(false), 66 has_autofillable_field_(false),
66 has_password_fields_(false), 67 has_password_fields_(false),
67 autofill_count_(0) { 68 autofill_count_(0) {
68 // Copy the form fields. 69 // Copy the form fields.
69 std::vector<webkit_glue::FormField>::const_iterator field; 70 std::vector<webkit_glue::FormField>::const_iterator field;
70 for (field = form.fields.begin(); 71 for (field = form.fields.begin();
71 field != form.fields.end(); field++) { 72 field != form.fields.end(); field++) {
72 // We currently only handle text and select fields; however, we need to 73 // We currently only handle text and select fields; however, we need to
73 // store all fields in order to match the fields stored in the FormManager. 74 // store all fields in order to match the fields stored in the FormManager.
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } else { 410 } else {
410 buzz::XmlElement *field_element = new buzz::XmlElement( 411 buzz::XmlElement *field_element = new buzz::XmlElement(
411 buzz::QName(kXMLElementField)); 412 buzz::QName(kXMLElementField));
412 field_element->SetAttr(buzz::QName(kAttributeSignature), 413 field_element->SetAttr(buzz::QName(kAttributeSignature),
413 field->FieldSignature()); 414 field->FieldSignature());
414 encompassing_xml_element->AddElement(field_element); 415 encompassing_xml_element->AddElement(field_element);
415 } 416 }
416 } 417 }
417 return true; 418 return true;
418 } 419 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/form_structure.h ('k') | chrome/browser/autofill/form_structure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698