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

Side by Side Diff: components/autofill/core/browser/autofill_test_utils.cc

Issue 2728733002: Revert of [Autofill] Split server card data and metadata updates. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | components/autofill/core/browser/webdata/autofill_table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/autofill_test_utils.h" 5 #include "components/autofill/core/browser/autofill_test_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 318 }
319 319
320 void SetServerCreditCards(AutofillTable* table, 320 void SetServerCreditCards(AutofillTable* table,
321 const std::vector<CreditCard>& cards) { 321 const std::vector<CreditCard>& cards) {
322 std::vector<CreditCard> as_masked_cards = cards; 322 std::vector<CreditCard> as_masked_cards = cards;
323 for (CreditCard& card : as_masked_cards) { 323 for (CreditCard& card : as_masked_cards) {
324 card.set_record_type(CreditCard::MASKED_SERVER_CARD); 324 card.set_record_type(CreditCard::MASKED_SERVER_CARD);
325 std::string type = card.type(); 325 std::string type = card.type();
326 card.SetNumber(card.LastFourDigits()); 326 card.SetNumber(card.LastFourDigits());
327 card.SetTypeForMaskedCard(type.c_str()); 327 card.SetTypeForMaskedCard(type.c_str());
328 table->UpdateServerCardMetadata(card);
329 } 328 }
330 table->SetServerCreditCards(as_masked_cards); 329 table->SetServerCreditCards(as_masked_cards);
331 330
332 for (const CreditCard& card : cards) { 331 for (const CreditCard& card : cards) {
333 if (card.record_type() != CreditCard::FULL_SERVER_CARD) 332 if (card.record_type() != CreditCard::FULL_SERVER_CARD)
334 continue; 333 continue;
335 334
336 table->UnmaskServerCreditCard(card, card.number()); 335 table->UnmaskServerCreditCard(card, card.number());
337 } 336 }
338 } 337 }
(...skipping 20 matching lines...) Expand all
359 const char* control_type) { 358 const char* control_type) {
360 field->set_signature(signature); 359 field->set_signature(signature);
361 if (name) 360 if (name)
362 field->set_name(name); 361 field->set_name(name);
363 if (control_type) 362 if (control_type)
364 field->set_type(control_type); 363 field->set_type(control_type);
365 } 364 }
366 365
367 } // namespace test 366 } // namespace test
368 } // namespace autofill 367 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/webdata/autofill_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698