| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
" | 5 #include "chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/views/payments/validating_textfield.h" | 8 #include "chrome/browser/ui/views/payments/validating_textfield.h" |
| 9 #include "components/autofill/core/browser/autofill_country.h" | 9 #include "components/autofill/core/browser/autofill_country.h" |
| 10 #include "components/autofill/core/browser/autofill_profile.h" | 10 #include "components/autofill/core/browser/autofill_profile.h" |
| 11 #include "components/autofill/core/browser/autofill_type.h" | 11 #include "components/autofill/core/browser/autofill_type.h" |
| 12 #include "components/autofill/core/browser/personal_data_manager.h" | 12 #include "components/autofill/core/browser/personal_data_manager.h" |
| 13 #include "components/autofill/core/browser/validation.h" | 13 #include "components/autofill/core/browser/validation.h" |
| 14 #include "components/autofill/core/common/autofill_constants.h" | 14 #include "components/autofill/core/common/autofill_constants.h" |
| 15 #include "components/payments/content/payment_request_spec.h" | 15 #include "components/payments/content/payment_request_spec.h" |
| 16 #include "components/payments/content/payment_request_state.h" | 16 #include "components/payments/content/payment_request_state.h" |
| 17 #include "components/strings/grit/components_strings.h" | 17 #include "components/strings/grit/components_strings.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 #include "ui/base/models/simple_combobox_model.h" | 19 #include "ui/base/models/simple_combobox_model.h" |
| 20 #include "ui/views/controls/label.h" | 20 #include "ui/views/controls/label.h" |
| 21 #include "ui/views/controls/textfield/textfield.h" | 21 #include "ui/views/controls/textfield/textfield.h" |
| 22 | 22 |
| 23 namespace payments { | 23 namespace payments { |
| 24 | 24 |
| 25 ContactInfoEditorViewController::ContactInfoEditorViewController( | 25 ContactInfoEditorViewController::ContactInfoEditorViewController( |
| 26 PaymentRequestSpec* spec, | 26 PaymentRequestSpec* spec, |
| 27 PaymentRequestState* state, | 27 PaymentRequestState* state, |
| 28 PaymentRequestDialogView* dialog, | 28 PaymentRequestDialogView* dialog, |
| 29 BackNavigationType back_navigation_type, |
| 29 autofill::AutofillProfile* profile) | 30 autofill::AutofillProfile* profile) |
| 30 : EditorViewController(spec, state, dialog), profile_to_edit_(profile) {} | 31 : EditorViewController(spec, state, dialog, back_navigation_type), |
| 32 profile_to_edit_(profile) {} |
| 31 | 33 |
| 32 ContactInfoEditorViewController::~ContactInfoEditorViewController() {} | 34 ContactInfoEditorViewController::~ContactInfoEditorViewController() {} |
| 33 | 35 |
| 34 std::unique_ptr<views::View> | 36 std::unique_ptr<views::View> |
| 35 ContactInfoEditorViewController::CreateHeaderView() { | 37 ContactInfoEditorViewController::CreateHeaderView() { |
| 36 return base::MakeUnique<views::View>(); | 38 return base::MakeUnique<views::View>(); |
| 37 } | 39 } |
| 38 | 40 |
| 41 std::unique_ptr<views::View> |
| 42 ContactInfoEditorViewController::CreateCustomFieldsView() { |
| 43 return base::MakeUnique<views::View>(); |
| 44 } |
| 45 |
| 39 std::vector<EditorField> | 46 std::vector<EditorField> |
| 40 ContactInfoEditorViewController::GetFieldDefinitions() { | 47 ContactInfoEditorViewController::GetFieldDefinitions() { |
| 41 std::vector<EditorField> fields; | 48 std::vector<EditorField> fields; |
| 42 if (spec()->request_payer_name()) { | 49 if (spec()->request_payer_name()) { |
| 43 fields.push_back(EditorField( | 50 fields.push_back(EditorField( |
| 44 autofill::NAME_FULL, | 51 autofill::NAME_FULL, |
| 45 l10n_util::GetStringUTF16(IDS_PAYMENTS_NAME_FIELD_IN_CONTACT_DETAILS), | 52 l10n_util::GetStringUTF16(IDS_PAYMENTS_NAME_FIELD_IN_CONTACT_DETAILS), |
| 46 EditorField::LengthHint::HINT_LONG, /*required=*/true)); | 53 EditorField::LengthHint::HINT_LONG, /*required=*/true)); |
| 47 } | 54 } |
| 48 if (spec()->request_payer_phone()) { | 55 if (spec()->request_payer_phone()) { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 197 } |
| 191 | 198 |
| 192 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 199 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
| 193 ValidateCombobox(views::Combobox* combobox) { | 200 ValidateCombobox(views::Combobox* combobox) { |
| 194 // This UI doesn't contain any comboboxes. | 201 // This UI doesn't contain any comboboxes. |
| 195 NOTREACHED(); | 202 NOTREACHED(); |
| 196 return true; | 203 return true; |
| 197 } | 204 } |
| 198 | 205 |
| 199 } // namespace payments | 206 } // namespace payments |
| OLD | NEW |