| Index: third_party/libaddressinput/chromium/cpp/src/country_rules_retriever.h
|
| diff --git a/third_party/libaddressinput/chromium/cpp/src/country_rules_retriever.h b/third_party/libaddressinput/chromium/cpp/src/country_rules_retriever.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2b161d8b88b5e06c2add5405739342eb78f924d0
|
| --- /dev/null
|
| +++ b/third_party/libaddressinput/chromium/cpp/src/country_rules_retriever.h
|
| @@ -0,0 +1,55 @@
|
| +// 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.
|
| +
|
| +#ifndef I18N_ADDRESSINPUT_COUNTRY_RULES_RETRIEVER_H_
|
| +#define I18N_ADDRESSINPUT_COUNTRY_RULES_RETRIEVER_H_
|
| +
|
| +#include <libaddressinput/callback.h>
|
| +#include <libaddressinput/util/basictypes.h>
|
| +#include <libaddressinput/util/scoped_ptr.h>
|
| +
|
| +#include <string>
|
| +
|
| +namespace i18n {
|
| +namespace addressinput {
|
| +
|
| +class LookupKey;
|
| +class RuleRetriever;
|
| +
|
| +class CountryRulesRetriever {
|
| + public:
|
| + typedef i18n::addressinput::Callback<std::string, LookupKey> Callback;
|
| +
|
| + // Takes ownership of |rule_retriever|.
|
| + explicit CountryRulesRetriever(const RuleRetriever* rule_retriever);
|
| + ~CountryRulesRetriever();
|
| +
|
| + // Recursively retrieves all of the rules for |country_code| and its
|
| + // administrative areas, localities, and dependent localities. Places the
|
| + // rules in the tree rooted at |lookup_ready|. Invokes the |rules_ready|
|
| + // callback when finished.
|
| + void RetrieveRules(const std::string& country_code,
|
| + const Callback& rules_ready,
|
| + LookupKey* lookup_key) const;
|
| +
|
| + private:
|
| + scoped_ptr<const RuleRetriever> rule_retriever_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(CountryRulesRetriever);
|
| +};
|
| +
|
| +} // namespace addressinput
|
| +} // namespace i18n
|
| +
|
| +#endif // I18N_ADDRESSINPUT_COUNTRY_RULES_RETRIEVER_H_
|
|
|