Home | History | Annotate | Download | only in autofill
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
      6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
      7 
      8 #include <string>
      9 
     10 #include "base/callback.h"
     11 #include "base/strings/string16.h"
     12 #include "chrome/browser/ui/autofill/autofill_dialog_common.h"
     13 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
     14 #include "components/autofill/core/browser/autofill_type.h"
     15 
     16 namespace autofill {
     17 
     18 class AutofillProfile;
     19 class CreditCard;
     20 
     21 namespace i18ninput {
     22 
     23 // Builds internationalized address input fields for |address_type| (e.g.
     24 // billing or shipping) in |country_code| (e.g. "US" or "CH").
     25 //
     26 // The |inputs| and |language_code| are output-only parameters.
     27 //
     28 // The function adds the fields (at most 13) to |inputs|. This parameter should
     29 // not be NULL.
     30 //
     31 // The function sets the |language_code| to be used for address formatting. This
     32 // parameter can be NULL.
     33 void BuildAddressInputs(common::AddressType address_type,
     34                         const std::string& country_code,
     35                         DetailInputs* inputs,
     36                         std::string* language_code);
     37 
     38 // Returns whether the given card is complete and verified (i.e. was reviewed
     39 // by the user and not just automatically aggregated).
     40 bool CardHasCompleteAndVerifiedData(const CreditCard& card);
     41 
     42 // As above, but for the address in |profile|. Region-aware, meaning that the
     43 // exact set of required fields depends on the region.
     44 bool AddressHasCompleteAndVerifiedData(const AutofillProfile& profile,
     45                                        const std::string& app_locale);
     46 
     47 }  // namespace i18ninput
     48 }  // namespace autofill
     49 
     50 #endif  // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_I18N_INPUT_H_
     51