OLD | NEW |
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/core/browser/webdata/autofill_table.h" | 5 #include "components/autofill/core/browser/webdata/autofill_table.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 std::vector<AutofillChange>* changes, | 695 std::vector<AutofillChange>* changes, |
696 Time time) { | 696 Time time) { |
697 // Only add one new entry for each unique element name. Use |seen_names| to | 697 // Only add one new entry for each unique element name. Use |seen_names| to |
698 // track this. Add up to |kMaximumUniqueNames| unique entries per form. | 698 // track this. Add up to |kMaximumUniqueNames| unique entries per form. |
699 const size_t kMaximumUniqueNames = 256; | 699 const size_t kMaximumUniqueNames = 256; |
700 std::set<base::string16> seen_names; | 700 std::set<base::string16> seen_names; |
701 bool result = true; | 701 bool result = true; |
702 for (const FormFieldData& element : elements) { | 702 for (const FormFieldData& element : elements) { |
703 if (seen_names.size() >= kMaximumUniqueNames) | 703 if (seen_names.size() >= kMaximumUniqueNames) |
704 break; | 704 break; |
705 if (ContainsKey(seen_names, element.name)) | 705 if (base::ContainsKey(seen_names, element.name)) |
706 continue; | 706 continue; |
707 result = result && AddFormFieldValueTime(element, changes, time); | 707 result = result && AddFormFieldValueTime(element, changes, time); |
708 seen_names.insert(element.name); | 708 seen_names.insert(element.name); |
709 } | 709 } |
710 return result; | 710 return result; |
711 } | 711 } |
712 | 712 |
713 int AutofillTable::GetCountOfValuesContainedBetween( | 713 int AutofillTable::GetCountOfValuesContainedBetween( |
714 const Time& begin, | 714 const Time& begin, |
715 const Time& end) { | 715 const Time& end) { |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2305 } | 2305 } |
2306 | 2306 |
2307 bool AutofillTable::MigrateToVersion67AddMaskedCardBillingAddress() { | 2307 bool AutofillTable::MigrateToVersion67AddMaskedCardBillingAddress() { |
2308 // The default value for this column is null, but Connection::ColumnString() | 2308 // The default value for this column is null, but Connection::ColumnString() |
2309 // returns an empty string for that. | 2309 // returns an empty string for that. |
2310 return db_->Execute( | 2310 return db_->Execute( |
2311 "ALTER TABLE masked_credit_cards ADD COLUMN billing_address_id VARCHAR"); | 2311 "ALTER TABLE masked_credit_cards ADD COLUMN billing_address_id VARCHAR"); |
2312 } | 2312 } |
2313 | 2313 |
2314 } // namespace autofill | 2314 } // namespace autofill |
OLD | NEW |