OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "chrome/browser/ui/autofill/autofill_dialog_common.h" | 12 #include "chrome/browser/ui/autofill/autofill_dialog_common.h" |
13 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 13 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
14 #include "components/autofill/core/browser/autofill_type.h" | 14 #include "components/autofill/core/browser/autofill_type.h" |
15 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre
ss_field.h" | 15 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre
ss_field.h" |
16 | 16 |
17 namespace i18n { | 17 namespace i18n { |
18 namespace addressinput { | 18 namespace addressinput { |
19 struct AddressData; | 19 struct AddressData; |
20 } | 20 } |
21 } | 21 } |
22 | 22 |
23 namespace autofill { | 23 namespace autofill { |
24 | 24 |
25 class AutofillProfile; | 25 class AutofillProfile; |
26 class CreditCard; | 26 class CreditCard; |
27 | 27 |
28 namespace i18ninput { | 28 namespace i18ninput { |
29 | 29 |
30 // Builds internationalized address input fields for |country_code| and adds | 30 // Builds internationalized address input fields for |address_type| (e.g. |
31 // them (at most 13) to |inputs|. |address_type| is which kind of address to | 31 // billing or shipping) in |country_code| (e.g. "US" or "CH"). |
32 // build (e.g. billing or shipping). | 32 // |
| 33 // The |inputs| and |language_code| are output-only parameters. |
| 34 // |
| 35 // The function adds the fields (at most 13) to |inputs|. This parameter should |
| 36 // not be NULL. |
| 37 // |
| 38 // The function sets the |language_code| to be used for address formatting. This |
| 39 // parameter can be NULL. |
33 void BuildAddressInputs(common::AddressType address_type, | 40 void BuildAddressInputs(common::AddressType address_type, |
34 const std::string& country_code, | 41 const std::string& country_code, |
35 DetailInputs* inputs); | 42 DetailInputs* inputs, |
| 43 std::string* language_code); |
36 | 44 |
37 // Returns whether the given card is complete and verified (i.e. was reviewed | 45 // Returns whether the given card is complete and verified (i.e. was reviewed |
38 // by the user and not just automatically aggregated). | 46 // by the user and not just automatically aggregated). |
39 bool CardHasCompleteAndVerifiedData(const CreditCard& card); | 47 bool CardHasCompleteAndVerifiedData(const CreditCard& card); |
40 | 48 |
41 // As above, but for the address in |profile|. Region-aware, meaning that the | 49 // As above, but for the address in |profile|. Region-aware, meaning that the |
42 // exact set of required fields depends on the region. | 50 // exact set of required fields depends on the region. |
43 bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile); | 51 bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile); |
44 | 52 |
45 // Returns the corresponding Autofill server type for |field|. | 53 // Returns the corresponding Autofill server type for |field|. |
(...skipping 14 matching lines...) Expand all Loading... |
60 | 68 |
61 // Whether or not |country_code| has a fully supported address format. | 69 // Whether or not |country_code| has a fully supported address format. |
62 // TODO(dbeam): remove this when filling dependent locality is supported. | 70 // TODO(dbeam): remove this when filling dependent locality is supported. |
63 // http://crbug.com/340929 | 71 // http://crbug.com/340929 |
64 bool CountryIsFullySupported(const std::string& country_code); | 72 bool CountryIsFullySupported(const std::string& country_code); |
65 | 73 |
66 } // namespace i18ninput | 74 } // namespace i18ninput |
67 } // namespace autofill | 75 } // namespace autofill |
68 | 76 |
69 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ | 77 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ |
OLD | NEW |