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

Side by Side Diff: components/autofill/core/browser/webdata/autofill_table.cc

Issue 2619423002: [Payments] Preserve Wallet's card to billing address link after sync. (Closed)
Patch Set: Fixed comment Created 3 years, 11 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/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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 std::unique_ptr<AutofillProfile> profile = GetAutofillProfile(guid); 935 std::unique_ptr<AutofillProfile> profile = GetAutofillProfile(guid);
936 if (!profile) 936 if (!profile)
937 return false; 937 return false;
938 profiles->push_back(std::move(profile)); 938 profiles->push_back(std::move(profile));
939 } 939 }
940 940
941 return s.Succeeded(); 941 return s.Succeeded();
942 } 942 }
943 943
944 bool AutofillTable::GetServerProfiles( 944 bool AutofillTable::GetServerProfiles(
945 std::vector<std::unique_ptr<AutofillProfile>>* profiles) { 945 std::vector<std::unique_ptr<AutofillProfile>>* profiles) const {
946 profiles->clear(); 946 profiles->clear();
947 947
948 sql::Statement s(db_->GetUniqueStatement( 948 sql::Statement s(db_->GetUniqueStatement(
949 "SELECT " 949 "SELECT "
950 "id," 950 "id,"
951 "use_count," 951 "use_count,"
952 "use_date," 952 "use_date,"
953 "recipient_name," 953 "recipient_name,"
954 "company_name," 954 "company_name,"
955 "street_address," 955 "street_address,"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 std::unique_ptr<CreditCard> credit_card = GetCreditCard(guid); 1198 std::unique_ptr<CreditCard> credit_card = GetCreditCard(guid);
1199 if (!credit_card) 1199 if (!credit_card)
1200 return false; 1200 return false;
1201 credit_cards->push_back(std::move(credit_card)); 1201 credit_cards->push_back(std::move(credit_card));
1202 } 1202 }
1203 1203
1204 return s.Succeeded(); 1204 return s.Succeeded();
1205 } 1205 }
1206 1206
1207 bool AutofillTable::GetServerCreditCards( 1207 bool AutofillTable::GetServerCreditCards(
1208 std::vector<std::unique_ptr<CreditCard>>* credit_cards) { 1208 std::vector<std::unique_ptr<CreditCard>>* credit_cards) const {
1209 credit_cards->clear(); 1209 credit_cards->clear();
1210 1210
1211 sql::Statement s(db_->GetUniqueStatement( 1211 sql::Statement s(db_->GetUniqueStatement(
1212 "SELECT " 1212 "SELECT "
1213 "card_number_encrypted, " // 0 1213 "card_number_encrypted, " // 0
1214 "last_four," // 1 1214 "last_four," // 1
1215 "masked.id," // 2 1215 "masked.id," // 2
1216 "metadata.use_count," // 3 1216 "metadata.use_count," // 3
1217 "metadata.use_date," // 4 1217 "metadata.use_date," // 4
1218 "type," // 5 1218 "type," // 5
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 "storage_key VARCHAR PRIMARY KEY NOT NULL," 2467 "storage_key VARCHAR PRIMARY KEY NOT NULL,"
2468 "value BLOB)")) { 2468 "value BLOB)")) {
2469 return false; 2469 return false;
2470 } 2470 }
2471 return db_->Execute( 2471 return db_->Execute(
2472 "CREATE TABLE autofill_model_type_state (id INTEGER PRIMARY KEY, value " 2472 "CREATE TABLE autofill_model_type_state (id INTEGER PRIMARY KEY, value "
2473 "BLOB)"); 2473 "BLOB)");
2474 } 2474 }
2475 2475
2476 } // namespace autofill 2476 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698