autofill_dialog_i18n_input.h revision 116680a4aac90f2aa7413d9095a592090648e557
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include <string>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/callback.h"
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/strings/string16.h"
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/ui/autofill/autofill_dialog_common.h"
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "components/autofill/core/browser/autofill_type.h"
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace autofill {
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
187d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)class AutofillProfile;
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class CreditCard;
20c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace i18ninput {
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Builds internationalized address input fields for |address_type| (e.g.
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// billing or shipping) in |country_code| (e.g. "US" or "CH").
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The |inputs| and |language_code| are output-only parameters.
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// The function adds the fields (at most 13) to |inputs|. This parameter should
292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// not be NULL.
3058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)//
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The function sets the |language_code| to be used for address formatting. This
32868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// parameter can be NULL.
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void BuildAddressInputs(common::AddressType address_type,
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                        const std::string& country_code,
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                        DetailInputs* inputs,
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                        std::string* language_code);
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Returns whether the given card is complete and verified (i.e. was reviewed
392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// by the user and not just automatically aggregated).
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool CardHasCompleteAndVerifiedData(const CreditCard& card);
41b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
42b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// As above, but for the address in |profile|. Region-aware, meaning that the
43b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// exact set of required fields depends on the region.
44b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile,
45424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)                                       const std::string& app_locale);
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace i18ninput
482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace autofill
492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)