| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #import "ios/chrome/browser/payments/test_payment_request.h" | 5 #import "ios/chrome/browser/payments/test_payment_request.h" |
| 6 | 6 |
| 7 #include "components/autofill/core/browser/personal_data_manager.h" | 7 #include "components/autofill/core/browser/personal_data_manager.h" |
| 8 #include "components/autofill/core/browser/region_data_loader.h" | 8 #include "components/autofill/core/browser/region_data_loader.h" |
| 9 #include "components/payments/core/payments_profile_comparator.h" | 9 #include "components/payments/core/payments_profile_comparator.h" |
| 10 #include "components/prefs/pref_service.h" | 10 #include "components/prefs/pref_service.h" |
| 11 #include "ios/web/public/payments/payment_request.h" | 11 #include "ios/web/public/payments/payment_request.h" |
| 12 | 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) | 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." | 14 #error "This file requires ARC support." |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 namespace payments { |
| 18 |
| 17 void TestPaymentRequest::ClearShippingProfiles() { | 19 void TestPaymentRequest::ClearShippingProfiles() { |
| 18 shipping_profiles_.clear(); | 20 shipping_profiles_.clear(); |
| 19 } | 21 } |
| 20 | 22 |
| 21 void TestPaymentRequest::ClearContactProfiles() { | 23 void TestPaymentRequest::ClearContactProfiles() { |
| 22 contact_profiles_.clear(); | 24 contact_profiles_.clear(); |
| 23 } | 25 } |
| 24 | 26 |
| 25 void TestPaymentRequest::ClearPaymentMethods() { | 27 void TestPaymentRequest::ClearPaymentMethods() { |
| 26 payment_methods_.clear(); | 28 payment_methods_.clear(); |
| 27 } | 29 } |
| 28 | 30 |
| 29 autofill::RegionDataLoader* TestPaymentRequest::GetRegionDataLoader() { | 31 autofill::RegionDataLoader* TestPaymentRequest::GetRegionDataLoader() { |
| 30 if (region_data_loader_) | 32 if (region_data_loader_) |
| 31 return region_data_loader_; | 33 return region_data_loader_; |
| 32 return PaymentRequest::GetRegionDataLoader(); | 34 return PaymentRequest::GetRegionDataLoader(); |
| 33 } | 35 } |
| 34 | 36 |
| 35 PrefService* TestPaymentRequest::GetPrefService() { | 37 PrefService* TestPaymentRequest::GetPrefService() { |
| 36 if (pref_service_) | 38 if (pref_service_) |
| 37 return pref_service_; | 39 return pref_service_; |
| 38 return PaymentRequest::GetPrefService(); | 40 return PaymentRequest::GetPrefService(); |
| 39 } | 41 } |
| 40 | 42 |
| 41 payments::PaymentsProfileComparator* TestPaymentRequest::profile_comparator() { | 43 PaymentsProfileComparator* TestPaymentRequest::profile_comparator() { |
| 42 if (profile_comparator_) | 44 if (profile_comparator_) |
| 43 return profile_comparator_; | 45 return profile_comparator_; |
| 44 return PaymentRequest::profile_comparator(); | 46 return PaymentRequest::profile_comparator(); |
| 45 } | 47 } |
| 48 |
| 49 } // namespace payments |
| OLD | NEW |