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 #ifndef COMPONENTS_BROWSER_AUTOFILL_TEST_PERSONAL_DATA_MANAGER_H_ | 5 #ifndef COMPONENTS_BROWSER_AUTOFILL_TEST_PERSONAL_DATA_MANAGER_H_ |
6 #define COMPONENTS_BROWSER_AUTOFILL_TEST_PERSONAL_DATA_MANAGER_H_ | 6 #define COMPONENTS_BROWSER_AUTOFILL_TEST_PERSONAL_DATA_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "components/autofill/core/browser/autofill_profile.h" | 10 #include "components/autofill/core/browser/autofill_profile.h" |
11 #include "components/autofill/core/browser/credit_card.h" | 11 #include "components/autofill/core/browser/credit_card.h" |
12 #include "components/autofill/core/browser/personal_data_manager.h" | 12 #include "components/autofill/core/browser/personal_data_manager.h" |
13 | 13 |
14 namespace autofill { | 14 namespace autofill { |
15 | 15 |
16 // A simplistic PersonalDataManager used for testing. | 16 // A simplistic PersonalDataManager used for testing. |
17 class TestPersonalDataManager : public PersonalDataManager { | 17 class TestPersonalDataManager : public PersonalDataManager { |
18 public: | 18 public: |
19 TestPersonalDataManager(); | 19 TestPersonalDataManager(); |
20 virtual ~TestPersonalDataManager(); | 20 virtual ~TestPersonalDataManager(); |
21 | 21 |
22 // Adds |profile| to |profiles_|. This does not take ownership of |profile|. | 22 // Adds |profile| to |profiles_|. This does not take ownership of |profile|. |
23 void AddTestingProfile(AutofillProfile* profile); | 23 void AddTestingProfile(AutofillProfile* profile); |
24 | 24 |
25 // Adds |credit_card| to |credit_cards_|. This does not take ownership of | 25 // Adds |credit_card| to |credit_cards_|. This does not take ownership of |
26 // |credit_card|. | 26 // |credit_card|. |
27 void AddTestingCreditCard(CreditCard* credit_card); | 27 void AddTestingCreditCard(CreditCard* credit_card); |
28 | 28 |
29 virtual const std::vector<AutofillProfile*>& GetProfiles() const OVERRIDE; | 29 virtual const std::vector<AutofillProfile*>& GetProfiles() const OVERRIDE; |
30 virtual const std::vector<AutofillProfile*>& web_profiles() const OVERRIDE; | |
30 virtual const std::vector<CreditCard*>& GetCreditCards() const OVERRIDE; | 31 virtual const std::vector<CreditCard*>& GetCreditCards() const OVERRIDE; |
31 | 32 |
32 virtual std::string SaveImportedProfile( | 33 virtual std::string SaveImportedProfile( |
33 const AutofillProfile& imported_profile) OVERRIDE; | 34 const AutofillProfile& imported_profile) OVERRIDE; |
34 virtual std::string SaveImportedCreditCard( | 35 virtual std::string SaveImportedCreditCard( |
35 const CreditCard& imported_credit_card) OVERRIDE; | 36 const CreditCard& imported_credit_card) OVERRIDE; |
36 | 37 |
37 virtual const std::string& GetDefaultCountryCodeForNewAddress() const | 38 virtual std::string CountryCodeForCurrentTimezone() const OVERRIDE; |
Dan Beam
2014/01/02 22:10:39
^ why not keep this as a reference?
Evan Stade
2014/01/02 22:23:16
because the real implementation isn't able to retu
Dan Beam
2014/01/02 22:30:37
ah
| |
38 OVERRIDE; | |
39 | 39 |
40 void set_default_country_code(const std::string& default_country_code) { | 40 void set_timezone_country_code(const std::string& timezone_country_code) { |
41 default_country_code_ = default_country_code; | 41 timezone_country_code_ = timezone_country_code; |
42 } | 42 } |
43 | 43 |
44 const AutofillProfile& imported_profile() { return imported_profile_; } | 44 const AutofillProfile& imported_profile() { return imported_profile_; } |
45 const CreditCard& imported_credit_card() { return imported_credit_card_; } | 45 const CreditCard& imported_credit_card() { return imported_credit_card_; } |
46 | 46 |
47 private: | 47 private: |
48 std::vector<AutofillProfile*> profiles_; | 48 std::vector<AutofillProfile*> profiles_; |
49 std::vector<CreditCard*> credit_cards_; | 49 std::vector<CreditCard*> credit_cards_; |
50 AutofillProfile imported_profile_; | 50 AutofillProfile imported_profile_; |
51 CreditCard imported_credit_card_; | 51 CreditCard imported_credit_card_; |
52 std::string default_country_code_; | 52 std::string timezone_country_code_; |
53 }; | 53 }; |
54 | 54 |
55 } // namespace autofill | 55 } // namespace autofill |
56 | 56 |
57 #endif // COMPONENTS_BROWSER_AUTOFILL_TEST_PERSONAL_DATA_MANAGER_H_ | 57 #endif // COMPONENTS_BROWSER_AUTOFILL_TEST_PERSONAL_DATA_MANAGER_H_ |
OLD | NEW |