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
3 // found in the LICENSE file.
5 #include "components/autofill/core/browser/test_personal_data_manager.h"
7 #include "components/autofill/core/browser/personal_data_manager_observer.h"
11 TestPersonalDataManager::TestPersonalDataManager()
12 : PersonalDataManager("en-US") {}
14 TestPersonalDataManager::~TestPersonalDataManager() {}
16 void TestPersonalDataManager::AddTestingProfile(AutofillProfile* profile) {
17 profiles_.push_back(profile);
18 FOR_EACH_OBSERVER(PersonalDataManagerObserver, observers_,
19 OnPersonalDataChanged());
22 void TestPersonalDataManager::AddTestingCreditCard(CreditCard* credit_card) {
23 credit_cards_.push_back(credit_card);
24 FOR_EACH_OBSERVER(PersonalDataManagerObserver, observers_,
25 OnPersonalDataChanged());
28 const std::vector<AutofillProfile*>& TestPersonalDataManager::GetProfiles()
33 const std::vector<CreditCard*>& TestPersonalDataManager::
34 GetCreditCards() const {
38 std::string TestPersonalDataManager::SaveImportedProfile(
39 const AutofillProfile& imported_profile) {
40 imported_profile_ = imported_profile;
41 return imported_profile.guid();
44 std::string TestPersonalDataManager::SaveImportedCreditCard(
45 const CreditCard& imported_credit_card) {
46 imported_credit_card_ = imported_credit_card;
47 return imported_credit_card.guid();
50 } // namespace autofill