summaryrefslogtreecommitdiffstats
path: root/components/autofill/browser/test_personal_data_manager.cc
blob: 1d904d8fb4889d9b36519b06b20ed1b95d91c9bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/autofill/browser/test_personal_data_manager.h"

#include "components/autofill/browser/personal_data_manager_observer.h"

namespace autofill {

TestPersonalDataManager::TestPersonalDataManager()
    : PersonalDataManager("en-US") {}

TestPersonalDataManager::~TestPersonalDataManager() {}

void TestPersonalDataManager::AddTestingProfile(AutofillProfile* profile) {
  profiles_.push_back(profile);
  FOR_EACH_OBSERVER(PersonalDataManagerObserver, observers_,
                    OnPersonalDataChanged());
}

void TestPersonalDataManager::AddTestingCreditCard(CreditCard* credit_card) {
  credit_cards_.push_back(credit_card);
  FOR_EACH_OBSERVER(PersonalDataManagerObserver, observers_,
                    OnPersonalDataChanged());
}

const std::vector<AutofillProfile*>& TestPersonalDataManager::GetProfiles() {
  return profiles_;
}

const std::vector<CreditCard*>& TestPersonalDataManager::
    GetCreditCards() const {
  return credit_cards_;
}

void TestPersonalDataManager::SaveImportedProfile(
    const AutofillProfile& imported_profile) {
  imported_profile_ = imported_profile;
}

}  // namespace autofill