15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file.
45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <string>
95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/callback.h"
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/strings/string16.h"
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "chrome/browser/ui/autofill/autofill_dialog_common.h"
135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "components/autofill/core/browser/autofill_type.h"
155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace autofill {
175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class AutofillProfile;
195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class CreditCard;
205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace i18ninput {
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
23a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// Builds internationalized address input fields for |address_type| (e.g.
24a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// billing or shipping) in |country_code| (e.g. "US" or "CH").
25a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch//
26a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// The |inputs| and |language_code| are output-only parameters.
27a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch//
28a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// The function adds the fields (at most 13) to |inputs|. This parameter should
29a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// not be NULL.
30a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch//
31a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// The function sets the |language_code| to be used for address formatting. This
32a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// parameter can be NULL.
335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)void BuildAddressInputs(common::AddressType address_type,
345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                        const std::string& country_code,
35a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch                        DetailInputs* inputs,
36a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch                        std::string* language_code);
375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Returns whether the given card is complete and verified (i.e. was reviewed
395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// by the user and not just automatically aggregated).
405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)bool CardHasCompleteAndVerifiedData(const CreditCard& card);
415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
425d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// As above, but for the address in |profile|. Region-aware, meaning that the
435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// exact set of required fields depends on the region.
44cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile,
45cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)                                       const std::string& app_locale);
465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
475d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}  // namespace i18ninput
485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}  // namespace autofill
495d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
505d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif  // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
51