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 // Adds the fields (at most 13) to |inputs|. The |inputs| parameter should not | |
34 // be NULL. | |
35 // | |
36 // Sets the |language_code| to be used for address formatting. The | |
37 // |language_code| parameter can be NULL. | |
33 void BuildAddressInputs(common::AddressType address_type, | 38 void BuildAddressInputs(common::AddressType address_type, |
34 const std::string& country_code, | 39 const std::string& country_code, |
35 DetailInputs* inputs); | 40 DetailInputs* inputs, |
41 std::string* language_code); | |
Evan Stade
2014/04/10 00:58:49
it's unclear to me from your above comment whether
please use gerrit instead
2014/04/10 20:39:45
It's an out-param. I've changed the comment to cla
| |
36 | 42 |
37 // Returns whether the given card is complete and verified (i.e. was reviewed | 43 // Returns whether the given card is complete and verified (i.e. was reviewed |
38 // by the user and not just automatically aggregated). | 44 // by the user and not just automatically aggregated). |
39 bool CardHasCompleteAndVerifiedData(const CreditCard& card); | 45 bool CardHasCompleteAndVerifiedData(const CreditCard& card); |
40 | 46 |
41 // As above, but for the address in |profile|. Region-aware, meaning that the | 47 // As above, but for the address in |profile|. Region-aware, meaning that the |
42 // exact set of required fields depends on the region. | 48 // exact set of required fields depends on the region. |
43 bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile); | 49 bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile); |
44 | 50 |
45 // Returns the corresponding Autofill server type for |field|. | 51 // Returns the corresponding Autofill server type for |field|. |
(...skipping 14 matching lines...) Expand all Loading... | |
60 | 66 |
61 // Whether or not |country_code| has a fully supported address format. | 67 // Whether or not |country_code| has a fully supported address format. |
62 // TODO(dbeam): remove this when filling dependent locality is supported. | 68 // TODO(dbeam): remove this when filling dependent locality is supported. |
63 // http://crbug.com/340929 | 69 // http://crbug.com/340929 |
64 bool CountryIsFullySupported(const std::string& country_code); | 70 bool CountryIsFullySupported(const std::string& country_code); |
65 | 71 |
66 } // namespace i18ninput | 72 } // namespace i18ninput |
67 } // namespace autofill | 73 } // namespace autofill |
68 | 74 |
69 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ | 75 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ |
OLD | NEW |