| Index: chrome/browser/ui/autofill/autofill_dialog_input_i18n.h
|
| diff --git a/chrome/browser/ui/autofill/autofill_dialog_input_i18n.h b/chrome/browser/ui/autofill/autofill_dialog_input_i18n.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a13eecdebde1ece6347adfcc53ed66d8bed3791b
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/autofill/autofill_dialog_input_i18n.h
|
| @@ -0,0 +1,60 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_INPUT_I18N_H_
|
| +#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_INPUT_I18N_H_
|
| +
|
| +#include "chrome/browser/ui/autofill/autofill_dialog_input.h"
|
| +
|
| +namespace autofill {
|
| +namespace common {
|
| +
|
| +// An implementation of AutofillDialogInput with internationalized fields. This
|
| +// implementation allows changing the country/region field. Do not instantiate
|
| +// this object directly. Use AutofillDialogInput::BuildInstance() instead.
|
| +class AutofillDialogInputI18n : public AutofillDialogInput {
|
| + public:
|
| + AutofillDialogInputI18n();
|
| + virtual ~AutofillDialogInputI18n();
|
| +
|
| + // AutofillDialogInput implementation.
|
| + virtual void BuildInputsForSection(DialogSection dialog_section,
|
| + DetailInputs* inputs) OVERRIDE;
|
| + virtual void BuildInputsForSection(DialogSection dialog_section,
|
| + const std::string& selected_country_region,
|
| + DetailInputs* inputs) OVERRIDE;
|
| +
|
| + private:
|
| + enum AddressType {
|
| + ADDRESS_TYPE_BILLING,
|
| + ADDRESS_TYPE_SHIPPING,
|
| + };
|
| +
|
| + // Converts a home-address |field_type| into a billing-address field if
|
| + // |address_type| is ADDRESS_TYPE_BILLING. Otherwise returns the original
|
| + // field type.
|
| + static ServerFieldType GetFieldType(AddressType address_type,
|
| + ServerFieldType field_type);
|
| +
|
| + // Builds the autofill |inputs| for |dialog_section| with the specified
|
| + // |country_region| and |language| specific inputs.
|
| + void BuildLocalizedInputs(DialogSection dialog_section,
|
| + const std::string& language,
|
| + const std::string& country_region,
|
| + DetailInputs* inputs);
|
| +
|
| + // Builds only the address part of |inputs| starting at |field_row|.
|
| + int BuildAddressInputs(AddressType type,
|
| + int field_row,
|
| + const std::string& language,
|
| + const std::string& country_region,
|
| + DetailInputs* inputs);
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AutofillDialogInputI18n);
|
| +};
|
| +
|
| +} // namespace common
|
| +} // namespace autofill
|
| +
|
| +#endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_INPUT_I18N_H_
|
|
|