Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 923 } | 923 } |
| 924 | 924 |
| 925 bool AutofillTable::GetAutofillProfiles( | 925 bool AutofillTable::GetAutofillProfiles( |
| 926 std::vector<AutofillProfile*>* profiles) { | 926 std::vector<AutofillProfile*>* profiles) { |
| 927 DCHECK(profiles); | 927 DCHECK(profiles); |
| 928 profiles->clear(); | 928 profiles->clear(); |
| 929 | 929 |
| 930 sql::Statement s(db_->GetUniqueStatement( | 930 sql::Statement s(db_->GetUniqueStatement( |
| 931 "SELECT guid " | 931 "SELECT guid " |
| 932 "FROM autofill_profiles " | 932 "FROM autofill_profiles " |
| 933 "ORDER BY date_modified, guid")); | 933 "ORDER BY date_modified DESC, guid")); |
|
Evan Stade
2014/09/25 00:00:06
I meant here, not on trunk
Ilya Sherman
2014/09/25 00:08:55
Oh, I have no idea how I missed that. My bad.
| |
| 934 | 934 |
| 935 while (s.Step()) { | 935 while (s.Step()) { |
| 936 std::string guid = s.ColumnString(0); | 936 std::string guid = s.ColumnString(0); |
| 937 AutofillProfile* profile = NULL; | 937 AutofillProfile* profile = NULL; |
| 938 if (!GetAutofillProfile(guid, &profile)) | 938 if (!GetAutofillProfile(guid, &profile)) |
| 939 return false; | 939 return false; |
| 940 profiles->push_back(profile); | 940 profiles->push_back(profile); |
| 941 } | 941 } |
| 942 | 942 |
| 943 return s.Succeeded(); | 943 return s.Succeeded(); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 bool AutofillTable::GetCreditCards( | 1064 bool AutofillTable::GetCreditCards( |
| 1065 std::vector<CreditCard*>* credit_cards) { | 1065 std::vector<CreditCard*>* credit_cards) { |
| 1066 DCHECK(credit_cards); | 1066 DCHECK(credit_cards); |
| 1067 credit_cards->clear(); | 1067 credit_cards->clear(); |
| 1068 | 1068 |
| 1069 sql::Statement s(db_->GetUniqueStatement( | 1069 sql::Statement s(db_->GetUniqueStatement( |
| 1070 "SELECT guid " | 1070 "SELECT guid " |
| 1071 "FROM credit_cards " | 1071 "FROM credit_cards " |
| 1072 "ORDER BY date_modified, guid")); | 1072 "ORDER BY date_modified DESC, guid")); |
| 1073 | 1073 |
| 1074 while (s.Step()) { | 1074 while (s.Step()) { |
| 1075 std::string guid = s.ColumnString(0); | 1075 std::string guid = s.ColumnString(0); |
| 1076 CreditCard* credit_card = NULL; | 1076 CreditCard* credit_card = NULL; |
| 1077 if (!GetCreditCard(guid, &credit_card)) | 1077 if (!GetCreditCard(guid, &credit_card)) |
| 1078 return false; | 1078 return false; |
| 1079 credit_cards->push_back(credit_card); | 1079 credit_cards->push_back(credit_card); |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 return s.Succeeded(); | 1082 return s.Succeeded(); |
| (...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2353 return db_->Execute("ALTER TABLE autofill_profiles " | 2353 return db_->Execute("ALTER TABLE autofill_profiles " |
| 2354 "ADD COLUMN language_code VARCHAR"); | 2354 "ADD COLUMN language_code VARCHAR"); |
| 2355 } | 2355 } |
| 2356 | 2356 |
| 2357 bool AutofillTable::MigrateToVersion57AddFullNameField() { | 2357 bool AutofillTable::MigrateToVersion57AddFullNameField() { |
| 2358 return db_->Execute("ALTER TABLE autofill_profile_names " | 2358 return db_->Execute("ALTER TABLE autofill_profile_names " |
| 2359 "ADD COLUMN full_name VARCHAR"); | 2359 "ADD COLUMN full_name VARCHAR"); |
| 2360 } | 2360 } |
| 2361 | 2361 |
| 2362 } // namespace autofill | 2362 } // namespace autofill |
| OLD | NEW |