Chromium Code Reviews| 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 { | |
| 35 | |
| 36 autofill::CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR, | |
|
sky
2017/02/06 18:07:14
Make sure you run git cl format.
Mathieu
2017/02/06 18:09:17
I relied on `git cl format' a little too heavily :
| |
| 37 l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_EXPIRATION_DATE), | |
| 38 EditorField::LengthHint::HINT_SHORT}}; | |
| 39 } | |
| 40 | |
| 41 bool CreditCardEditorViewController::ValidateModelAndSave() { | |
| 42 // TODO(mathp): Actual validation and saving the model on disk. | |
| 43 return true; | |
| 44 } | |
| 45 | |
| 46 } // namespace payments | |
| OLD | NEW |