[rac] Download all rules for a country code in libaddressinput.
commitedf37bf17c9554a84dffd996df669414a1b5a0af
authorrouslan@chromium.org <rouslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 9 Jan 2014 04:05:06 +0000 (9 04:05 +0000)
committerrouslan@chromium.org <rouslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 9 Jan 2014 04:05:06 +0000 (9 04:05 +0000)
treeacf2b85f7426837206d1882dfa540faf39246146
parentbd951a6fae98dc010626ad37cdb8d3c9602d3529
[rac] Download all rules for a country code in libaddressinput.

This patch enables downloading all rules for a country code. The rules are
organized into a Ruleset tree, where nodes contain region-wide rules,
language-specific rules, and Rulesets for the sub-regions.

For example, the country code of Canada is "CA". The Ruleset for "CA"
contains the general validation rules for Canada in the default language
of the country, which is English, or "en".

One of the child nodes of "CA" is a Rule for "fr" language. This Rule
contains the general validation rules for Canada in the French language.

The rest of the child nodes of "CA" are the Ruleset objects for all of the
Canada's provinces. For example, there's a Ruleset for "BC" for British
Columbia.

Example of a Ruleset for Canada and some of its provinces:

                  CA-->fr
                  |
-------------------------------------
|        |        |        |        |
v        v        v        v        v
AB-->fr  BC-->fr  MB-->fr  NB-->fr  NL-->fr

BUG=327046

Review URL: https://codereview.chromium.org/109323011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243754 0039d316-1c4b-4281-b951-d872f2087c98
14 files changed:
third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_validator.h
third_party/libaddressinput/chromium/cpp/include/libaddressinput/callback.h
third_party/libaddressinput/chromium/cpp/libaddressinput.gyp
third_party/libaddressinput/chromium/cpp/src/address_ui.cc
third_party/libaddressinput/chromium/cpp/src/address_validator.cc
third_party/libaddressinput/chromium/cpp/src/country_rules_aggregator.cc [new file with mode: 0644]
third_party/libaddressinput/chromium/cpp/src/country_rules_aggregator.h [new file with mode: 0644]
third_party/libaddressinput/chromium/cpp/src/retriever.cc
third_party/libaddressinput/chromium/cpp/src/rule.cc
third_party/libaddressinput/chromium/cpp/src/rule.h
third_party/libaddressinput/chromium/cpp/src/ruleset.cc [new file with mode: 0644]
third_party/libaddressinput/chromium/cpp/src/ruleset.h [new file with mode: 0644]
third_party/libaddressinput/chromium/cpp/test/retriever_test.cc
third_party/libaddressinput/libaddressinput.gyp