Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_i18n_input.h

Issue 145553009: rAc: use libaddressinput to validate international addresses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/ui/autofill/autofill_dialog_common.h" 8 #include "chrome/browser/ui/autofill/autofill_dialog_common.h"
9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" 9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
10 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre ss_field.h"
10 11
11 namespace autofill { 12 namespace autofill {
12 13
13 class AutofillProfile; 14 class AutofillProfile;
14 class CreditCard; 15 class CreditCard;
15 16
16 namespace i18ninput { 17 namespace i18ninput {
17 18
18 // Returns true if the internationalized address input is enabled. 19 // Returns true if the internationalized address input is enabled.
19 bool Enabled(); 20 bool Enabled();
20 21
21 // Builds internationalized address input fields for |country_code| and adds 22 // Builds internationalized address input fields for |country_code| and adds
22 // them (at most 13) to |inputs|. |address_type| is which kind of address to 23 // them (at most 13) to |inputs|. |address_type| is which kind of address to
23 // build (e.g. billing or shipping). 24 // build (e.g. billing or shipping).
24 void BuildAddressInputs(common::AddressType address_type, 25 void BuildAddressInputs(common::AddressType address_type,
25 const std::string& country_code, 26 const std::string& country_code,
26 DetailInputs* inputs); 27 DetailInputs* inputs);
27 28
28 // Returns whether the given card is complete and verified (i.e. was reviewed 29 // Returns whether the given card is complete and verified (i.e. was reviewed
29 // by the user and not just automatically aggregated). 30 // by the user and not just automatically aggregated).
30 bool CardHasCompleteAndVerifiedData(const CreditCard& card); 31 bool CardHasCompleteAndVerifiedData(const CreditCard& card);
31 32
32 // As above, but for the address in |profile|. Region-aware, meaning that the 33 // As above, but for the address in |profile|. Region-aware, meaning that the
33 // exact set of required fields depends on the region. 34 // exact set of required fields depends on the region.
34 bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile); 35 bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile);
35 36
37 // Returns the corresponding Autofill server type for |field|.
38 ServerFieldType TypeForField(::i18n::addressinput::AddressField field,
39 common::AddressType address_type);
40
36 } // namespace i18ninput 41 } // namespace i18ninput
37 } // namespace autofill 42 } // namespace autofill
38 43
39 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_ 44 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698