OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/payments/core/test_address_normalizer.h" |
| 6 |
| 7 namespace payments { |
| 8 |
| 9 bool TestAddressNormalizer::AreRulesLoadedForRegion( |
| 10 const std::string& region_code) { |
| 11 return true; |
| 12 } |
| 13 |
| 14 void TestAddressNormalizer::StartAddressNormalization( |
| 15 const autofill::AutofillProfile& profile, |
| 16 const std::string& region_code, |
| 17 int timeout_seconds, |
| 18 AddressNormalizer::Delegate* requester) { |
| 19 if (instantaneous_normalization_) { |
| 20 requester->OnAddressNormalized(profile); |
| 21 return; |
| 22 } |
| 23 |
| 24 // Setup the necessary variables for the delayed normalization. |
| 25 profile_ = profile; |
| 26 requester_ = requester; |
| 27 } |
| 28 |
| 29 void TestAddressNormalizer::DelayNormalization() { |
| 30 instantaneous_normalization_ = false; |
| 31 } |
| 32 |
| 33 void TestAddressNormalizer::CompleteAddressNormalization() { |
| 34 requester_->OnAddressNormalized(profile_); |
| 35 } |
| 36 |
| 37 } // namespace payments |
OLD | NEW |