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

Unified Diff: chrome/browser/ui/views/payments/cvc_unmask_view_controller.h

Issue 2779283002: [Web Payments] Implement the CVC Unmask dialog. (Closed)
Patch Set: Created 3 years, 9 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/cvc_unmask_view_controller.h
diff --git a/chrome/browser/ui/views/payments/cvc_unmask_view_controller.h b/chrome/browser/ui/views/payments/cvc_unmask_view_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f50f778979dfcabc27cfde0299b9f2237656bfe
--- /dev/null
+++ b/chrome/browser/ui/views/payments/cvc_unmask_view_controller.h
@@ -0,0 +1,57 @@
+// 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.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CVC_UNMASK_VIEW_CONTROLLER_H_
+#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CVC_UNMASK_VIEW_CONTROLLER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/observer_list.h"
+#include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h"
+
+namespace views {
+class Textfield;
+}
+
+namespace payments {
+
+class CvcUnmaskViewController : public PaymentRequestSheetController {
+ public:
+ class Observer {
+ public:
+ virtual void OnCvcConfirmed(const base::string16& cvc) = 0;
+ virtual void OnClosed() = 0;
+ };
+
+ CvcUnmaskViewController(PaymentRequestSpec* spec,
+ PaymentRequestState* state,
+ PaymentRequestDialogView* dialog,
+ const base::string16& masked_card_number,
Mathieu 2017/03/30 14:37:32 CreditCard* to replace this arg and the next?
+ const std::string& card_type);
+ ~CvcUnmaskViewController() override;
+
+ void AddObserver(Observer* observer);
+
+ protected:
+ // PaymentRequestSheetController:
+ base::string16 GetSheetTitle() override;
+ void FillContentView(views::View* content_view) override;
+ std::unique_ptr<views::Button> CreatePrimaryButton() override;
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
+
+ private:
+ void RaiseOnCvcConfirmed();
+
+ base::ObserverList<Observer> observer_list_;
+ views::Textfield* cvc_field_;
+ base::string16 masked_card_number_;
+ std::string card_type_;
+
+ DISALLOW_COPY_AND_ASSIGN(CvcUnmaskViewController);
+};
+
+} // namespace payments
+
+#endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CVC_UNMASK_VIEW_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698