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

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

Issue 847023002: Changes to android autofill preferences for wallet integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: its own page Created 5 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/personal_data_manager.h" 5 #include "components/autofill/core/browser/personal_data_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <iterator> 9 #include <iterator>
10 10
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 if (existing_credit_card->record_type() == CreditCard::MASKED_SERVER_CARD) { 599 if (existing_credit_card->record_type() == CreditCard::MASKED_SERVER_CARD) {
600 database_->UnmaskServerCreditCard(credit_card.server_id(), 600 database_->UnmaskServerCreditCard(credit_card.server_id(),
601 credit_card.number()); 601 credit_card.number());
602 } else { 602 } else {
603 database_->MaskServerCreditCard(credit_card.server_id()); 603 database_->MaskServerCreditCard(credit_card.server_id());
604 } 604 }
605 605
606 Refresh(); 606 Refresh();
607 } 607 }
608 608
609 void PersonalDataManager::ResetFullServerCards() {
610 for (const CreditCard* card : server_credit_cards_) {
611 CreditCard card_copy = *card;
612 if (card_copy.record_type() == CreditCard::FULL_SERVER_CARD) {
613 card_copy.set_record_type(CreditCard::MASKED_SERVER_CARD);
614 card_copy.SetNumber(card->LastFourDigits());
615 UpdateServerCreditCard(card_copy);
616 }
617 }
618 }
619
609 void PersonalDataManager::RemoveByGUID(const std::string& guid) { 620 void PersonalDataManager::RemoveByGUID(const std::string& guid) {
610 if (is_off_the_record_) 621 if (is_off_the_record_)
611 return; 622 return;
612 623
613 bool is_credit_card = FindByGUID<CreditCard>(local_credit_cards_, guid); 624 bool is_credit_card = FindByGUID<CreditCard>(local_credit_cards_, guid);
614 bool is_profile = !is_credit_card && 625 bool is_profile = !is_credit_card &&
615 FindByGUID<AutofillProfile>(web_profiles_, guid); 626 FindByGUID<AutofillProfile>(web_profiles_, guid);
616 if (!is_credit_card && !is_profile) 627 if (!is_credit_card && !is_profile)
617 return; 628 return;
618 629
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 1205
1195 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); 1206 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end());
1196 profiles_.insert( 1207 profiles_.insert(
1197 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end()); 1208 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end());
1198 profiles_.insert( 1209 profiles_.insert(
1199 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); 1210 profiles_.end(), server_profiles_.begin(), server_profiles_.end());
1200 return profiles_; 1211 return profiles_;
1201 } 1212 }
1202 1213
1203 } // namespace autofill 1214 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698