Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc

Issue 2676663002: [Payments] Implements the credit card editor for Desktop UI (Closed)
Patch Set: formatting Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fd14fbea612ae0725ee0912a2b40955cb7512868
--- /dev/null
+++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
@@ -0,0 +1,44 @@
+// Copyright 2017 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.
+
+#include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h"
+
+#include <utility>
+
+#include "base/strings/string16.h"
+#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/autofill/core/browser/field_types.h"
+#include "components/payments/payment_request.h"
+#include "ui/base/l10n/l10n_util.h"
+
+namespace payments {
+
+CreditCardEditorViewController::CreditCardEditorViewController(
+ PaymentRequest* request,
+ PaymentRequestDialogView* dialog)
+ : EditorViewController(request, dialog) {}
+
+CreditCardEditorViewController::~CreditCardEditorViewController() {}
+
+std::vector<EditorField> CreditCardEditorViewController::GetFieldDefinitions() {
+ return std::vector<EditorField>{
+ {autofill::CREDIT_CARD_NUMBER,
+ l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_CREDIT_CARD_NUMBER),
+ EditorField::LengthHint::HINT_LONG},
+ {autofill::CREDIT_CARD_NAME_FULL,
+ l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_NAME_ON_CARD),
+ EditorField::LengthHint::HINT_LONG},
+ {autofill::CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR,
+ l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_EXPIRATION_DATE),
+ EditorField::LengthHint::HINT_SHORT}};
+}
+
+bool CreditCardEditorViewController::ValidateModelAndSave() {
+ // TODO(mathp): Actual validation and saving the model on disk.
+ return true;
+}
+
+} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698