| Index: third_party/libaddressinput/chromium/cpp/src/address_validator.cc
|
| diff --git a/third_party/libaddressinput/chromium/cpp/src/address_validator.cc b/third_party/libaddressinput/chromium/cpp/src/address_validator.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..62e530461c872039d5471c225bf6c68c05ce5b7f
|
| --- /dev/null
|
| +++ b/third_party/libaddressinput/chromium/cpp/src/address_validator.cc
|
| @@ -0,0 +1,56 @@
|
| +// Copyright (C) 2013 Google Inc.
|
| +//
|
| +// Licensed under the Apache License, Version 2.0 (the "License");
|
| +// you may not use this file except in compliance with the License.
|
| +// You may obtain a copy of the License at
|
| +//
|
| +// http://www.apache.org/licenses/LICENSE-2.0
|
| +//
|
| +// Unless required by applicable law or agreed to in writing, software
|
| +// distributed under the License is distributed on an "AS IS" BASIS,
|
| +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| +// See the License for the specific language governing permissions and
|
| +// limitations under the License.
|
| +
|
| +#include <libaddressinput/address_validator.h>
|
| +
|
| +#include <libaddressinput/downloader.h>
|
| +#include <libaddressinput/load_rules_observer.h>
|
| +#include <libaddressinput/storage.h>
|
| +
|
| +#include <cassert>
|
| +#include <cstddef>
|
| +#include <string>
|
| +
|
| +#include "retriever.h"
|
| +#include "rule_retriever.h"
|
| +#include "validating_storage.h"
|
| +
|
| +namespace i18n {
|
| +namespace addressinput {
|
| +
|
| +AddressValidator::AddressValidator(const Downloader* downloader,
|
| + Storage* storage)
|
| + : rule_retriever_(new RuleRetriever(new Retriever(
|
| + VALIDATION_DATA_URL, downloader, new ValidatingStorage(storage)))) {}
|
| +
|
| +AddressValidator::~AddressValidator() {}
|
| +
|
| +void AddressValidator::LoadRules(const std::string& country_code,
|
| + bool force,
|
| + LoadRulesObserver* observer) {
|
| + assert(observer != NULL);
|
| + observer->OnAddressValidationRulesLoaded(country_code, false);
|
| +}
|
| +
|
| +AddressValidator::Result AddressValidator::ValidateAddress(
|
| + const AddressData& address,
|
| + const AddressProblemFilter& filter,
|
| + AddressProblems* problems) const {
|
| + assert(problems != NULL);
|
| + problems->clear();
|
| + return LOAD_RULES_FAIL;
|
| +}
|
| +
|
| +} // namespace addressinput
|
| +} // namespace i18n
|
|
|