summaryrefslogtreecommitdiff
path: root/chromium/components/autofill/core/browser/autofill_address_util.h
blob: e90ff5bfabe1d398a63fba2894dc67389398a5f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ADDRESS_UTIL_H_
#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ADDRESS_UTIL_H_

#include <string>

namespace base {
class ListValue;
class DictionaryValue;
}

namespace autofill {

class PersonalDataManager;

// Dictionary key for the field type.
extern const char kFieldTypeKey[];

// Dictionary key for the field length.
extern const char kFieldLengthKey[];

// Dictionary key for the field name.
extern const char kFieldNameKey[];

// Field name for autofill::NAME_FULL.
extern const char kFullNameField[];

// Field name for autofill::COMPANY_NAME.
extern const char kCompanyNameField[];

// Field name for autofill::ADDRESS_HOME_STREET_ADDRESS.
extern const char kAddressLineField[];

// Field name for autofill::ADDRESS_HOME_DEPENDENT_LOCALITY.
extern const char kDependentLocalityField[];

// Field name for autofill::ADDRESS_HOME_CITY.
extern const char kCityField[];

// Field name for autofill::ADDRESS_HOME_STATE.
extern const char kStateField[];

// Field name for autofill::ADDRESS_HOME_ZIP.
extern const char kPostalCodeField[];

// Field name for autofill::ADDRESS_HOME_SORTING_CODE.
extern const char kSortingCodeField[];

// Field name for autofill::ADDRESS_HOME_COUNTRY.
extern const char kCountryField[];

// AddressUiComponent::HINT_SHORT.
extern const char kShortField[];

// AddressUiComponent::HINT_LONG.
extern const char kLongField[];

// Fills |components| with the address UI components that should be used to
// input an address for |country_code| when UI BCP 47 language code is
// |ui_language_code|. If |components_language_code| is not NULL, then sets it
// to the BCP 47 language code that should be used to format the address for
// display.
void GetAddressComponents(const std::string& country_code,
                          const std::string& ui_language_code,
                          base::ListValue* address_components,
                          std::string* components_language_code);

// Sets data related to the country combobox.
void SetCountryData(const PersonalDataManager& manager,
                    base::DictionaryValue* localized_strings,
                    const std::string& ui_language_code);

}  // namespace autofill

#endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ADDRESS_UTIL_H_