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 NotifyPersonalDataChanged();
21 void TestPersonalDataManager::AddTestingCreditCard(CreditCard
* credit_card
) {
22 credit_cards_
.push_back(credit_card
);
23 NotifyPersonalDataChanged();
26 const std::vector
<AutofillProfile
*>& TestPersonalDataManager::GetProfiles()
31 const std::vector
<AutofillProfile
*>& TestPersonalDataManager::web_profiles()
36 const std::vector
<CreditCard
*>& TestPersonalDataManager::
37 GetCreditCards() const {
41 std::string
TestPersonalDataManager::SaveImportedProfile(
42 const AutofillProfile
& imported_profile
) {
43 imported_profile_
= imported_profile
;
44 return imported_profile
.guid();
47 std::string
TestPersonalDataManager::SaveImportedCreditCard(
48 const CreditCard
& imported_credit_card
) {
49 imported_credit_card_
= imported_credit_card
;
50 return imported_credit_card
.guid();
53 std::string
TestPersonalDataManager::CountryCodeForCurrentTimezone()
55 return timezone_country_code_
;
58 const std::string
& TestPersonalDataManager::GetDefaultCountryCodeForNewAddress()
60 if (default_country_code_
.empty())
61 return PersonalDataManager::GetDefaultCountryCodeForNewAddress();
63 return default_country_code_
;
66 } // namespace autofill