| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h" |
| 6 |
| 7 #include <utility> |
| 8 |
| 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" |
| 12 #include "chrome/grit/generated_resources.h" |
| 13 #include "components/autofill/core/browser/field_types.h" |
| 14 #include "components/payments/payment_request.h" |
| 15 #include "ui/base/l10n/l10n_util.h" |
| 16 |
| 17 namespace payments { |
| 18 |
| 19 CreditCardEditorViewController::CreditCardEditorViewController( |
| 20 PaymentRequest* request, |
| 21 PaymentRequestDialogView* dialog) |
| 22 : EditorViewController(request, dialog) {} |
| 23 |
| 24 CreditCardEditorViewController::~CreditCardEditorViewController() {} |
| 25 |
| 26 std::vector<EditorField> CreditCardEditorViewController::GetFieldDefinitions() { |
| 27 return std::vector<EditorField>{ |
| 28 {autofill::CREDIT_CARD_NUMBER, |
| 29 l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_CREDIT_CARD_NUMBER), |
| 30 EditorField::LengthHint::HINT_LONG}, |
| 31 {autofill::CREDIT_CARD_NAME_FULL, |
| 32 l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_NAME_ON_CARD), |
| 33 EditorField::LengthHint::HINT_LONG}, |
| 34 {autofill::CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR, |
| 35 l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_EXPIRATION_DATE), |
| 36 EditorField::LengthHint::HINT_SHORT}}; |
| 37 } |
| 38 |
| 39 bool CreditCardEditorViewController::ValidateModelAndSave() { |
| 40 // TODO(mathp): Actual validation and saving the model on disk. |
| 41 return true; |
| 42 } |
| 43 |
| 44 } // namespace payments |
| OLD | NEW |