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/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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 // Make the update. | 572 // Make the update. |
573 database_->UpdateCreditCard(credit_card); | 573 database_->UpdateCreditCard(credit_card); |
574 | 574 |
575 // Refresh our local cache and send notifications to observers. | 575 // Refresh our local cache and send notifications to observers. |
576 Refresh(); | 576 Refresh(); |
577 } | 577 } |
578 | 578 |
579 void PersonalDataManager::UpdateServerCreditCard( | 579 void PersonalDataManager::UpdateServerCreditCard( |
580 const CreditCard& credit_card) { | 580 const CreditCard& credit_card) { |
581 DCHECK_NE(CreditCard::LOCAL_CARD, credit_card.record_type()); | 581 DCHECK_NE(CreditCard::LOCAL_CARD, credit_card.record_type()); |
| 582 DCHECK(pref_service_->GetBoolean(prefs::kAutofillWalletImportStorageEnabled)); |
582 | 583 |
583 if (is_off_the_record_ || !database_.get()) | 584 if (is_off_the_record_ || !database_.get()) |
584 return; | 585 return; |
585 | 586 |
586 // Look up by server id, not GUID. | 587 // Look up by server id, not GUID. |
587 CreditCard* existing_credit_card = nullptr; | 588 CreditCard* existing_credit_card = nullptr; |
588 for (auto it : server_credit_cards_) { | 589 for (auto it : server_credit_cards_) { |
589 if (credit_card.server_id() == it->server_id()) { | 590 if (credit_card.server_id() == it->server_id()) { |
590 existing_credit_card = it; | 591 existing_credit_card = it; |
591 break; | 592 break; |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 profiles_.insert( | 1223 profiles_.insert( |
1223 profiles_.end(), auxiliary_profiles_.begin(), | 1224 profiles_.end(), auxiliary_profiles_.begin(), |
1224 auxiliary_profiles_.end()); | 1225 auxiliary_profiles_.end()); |
1225 } | 1226 } |
1226 profiles_.insert( | 1227 profiles_.insert( |
1227 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); | 1228 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); |
1228 return profiles_; | 1229 return profiles_; |
1229 } | 1230 } |
1230 | 1231 |
1231 } // namespace autofill | 1232 } // namespace autofill |
OLD | NEW |