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

Unified Diff: components/autofill/core/browser/webdata/autofill_table.cc

Issue 2948943003: Revert "Experiment to add bank name in autofill ui." (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/webdata/autofill_table.cc
diff --git a/components/autofill/core/browser/webdata/autofill_table.cc b/components/autofill/core/browser/webdata/autofill_table.cc
index 1cf28e683aa6559e836c24eb608cf9f71f9f61d0..d98db894172c3f288b1f49e3335a0a2b1ba8aa20 100644
--- a/components/autofill/core/browser/webdata/autofill_table.cc
+++ b/components/autofill/core/browser/webdata/autofill_table.cc
@@ -193,7 +193,6 @@ std::unique_ptr<CreditCard> CreditCardFromStatement(
base::Time::FromTimeT(s.ColumnInt64(index++)));
credit_card->set_origin(s.ColumnString(index++));
credit_card->set_billing_address_id(s.ColumnString(index++));
- credit_card->set_bank_name(s.ColumnString(index++));
return credit_card;
}
@@ -473,9 +472,6 @@ bool AutofillTable::MigrateToVersion(int version,
case 72:
*update_compatible_version = true;
return MigrateToVersion72RenameCardTypeToIssuerNetwork();
- case 73:
- *update_compatible_version = false;
- return MigrateToVersion73AddMaskedCardBankName();
}
return true;
}
@@ -1223,8 +1219,7 @@ bool AutofillTable::GetServerCreditCards(
"name_on_card," // 7
"exp_month," // 8
"exp_year," // 9
- "metadata.billing_address_id," // 10
- "bank_name " // 11
+ "metadata.billing_address_id " // 10
"FROM masked_credit_cards masked "
"LEFT OUTER JOIN unmasked_credit_cards USING (id) "
"LEFT OUTER JOIN server_card_metadata metadata USING (id)"));
@@ -1266,7 +1261,6 @@ bool AutofillTable::GetServerCreditCards(
card->SetRawInfo(CREDIT_CARD_EXP_MONTH, s.ColumnString16(index++));
card->SetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, s.ColumnString16(index++));
card->set_billing_address_id(s.ColumnString(index++));
- card->set_bank_name(s.ColumnString(index++));
credit_cards->push_back(std::move(card));
}
return s.Succeeded();
@@ -1283,9 +1277,8 @@ void AutofillTable::AddMaskedCreditCards(
"name_on_card," // 3
"last_four," // 4
"exp_month," // 5
- "exp_year," // 6
- "bank_name)" // 7
- "VALUES (?,?,?,?,?,?,?,?)"));
+ "exp_year)" // 6
+ "VALUES (?,?,?,?,?,?,?)"));
for (const CreditCard& card : credit_cards) {
DCHECK_EQ(CreditCard::MASKED_SERVER_CARD, card.record_type());
masked_insert.BindString(0, card.server_id());
@@ -1297,7 +1290,7 @@ void AutofillTable::AddMaskedCreditCards(
masked_insert.BindString16(5, card.GetRawInfo(CREDIT_CARD_EXP_MONTH));
masked_insert.BindString16(6,
card.GetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR));
- masked_insert.BindString(7, card.bank_name());
+
masked_insert.Run();
masked_insert.Reset(true);
@@ -1963,8 +1956,7 @@ bool AutofillTable::InitMaskedCreditCardsTable() {
"network VARCHAR,"
"last_four VARCHAR,"
"exp_month INTEGER DEFAULT 0,"
- "exp_year INTEGER DEFAULT 0, "
- "bank_name VARCHAR)")) {
+ "exp_year INTEGER DEFAULT 0)")) {
NOTREACHED();
return false;
}
@@ -2607,19 +2599,4 @@ bool AutofillTable::MigrateToVersion72RenameCardTypeToIssuerNetwork() {
transaction.Commit();
}
-bool AutofillTable::MigrateToVersion73AddMaskedCardBankName() {
- sql::Transaction transaction(db_);
- if (!transaction.Begin())
- return false;
-
- // Add the new bank_name column to the masked_credit_cards table.
- if (!db_->DoesColumnExist("masked_credit_cards", "bank_name") &&
- !db_->Execute("ALTER TABLE masked_credit_cards ADD COLUMN "
- "bank_name VARCHAR")) {
- return false;
- }
-
- return transaction.Commit();
-}
-
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698