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 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CVC_UNMASK_VIEW_CONTROLLER_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CVC_UNMASK_VIEW_CONTROLLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/observer_list.h" | |
| 12 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" | |
| 13 | |
| 14 namespace views { | |
| 15 class Textfield; | |
| 16 } | |
| 17 | |
| 18 namespace payments { | |
| 19 | |
| 20 class CvcUnmaskViewController : public PaymentRequestSheetController { | |
| 21 public: | |
| 22 class Observer { | |
| 23 public: | |
| 24 virtual void OnCvcConfirmed(const base::string16& cvc) = 0; | |
| 25 virtual void OnClosed() = 0; | |
| 26 }; | |
| 27 | |
| 28 CvcUnmaskViewController(PaymentRequestSpec* spec, | |
| 29 PaymentRequestState* state, | |
| 30 PaymentRequestDialogView* dialog, | |
| 31 const base::string16& masked_card_number, | |
|
Mathieu
2017/03/30 14:37:32
CreditCard* to replace this arg and the next?
| |
| 32 const std::string& card_type); | |
| 33 ~CvcUnmaskViewController() override; | |
| 34 | |
| 35 void AddObserver(Observer* observer); | |
| 36 | |
| 37 protected: | |
| 38 // PaymentRequestSheetController: | |
| 39 base::string16 GetSheetTitle() override; | |
| 40 void FillContentView(views::View* content_view) override; | |
| 41 std::unique_ptr<views::Button> CreatePrimaryButton() override; | |
| 42 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
| 43 | |
| 44 private: | |
| 45 void RaiseOnCvcConfirmed(); | |
| 46 | |
| 47 base::ObserverList<Observer> observer_list_; | |
| 48 views::Textfield* cvc_field_; | |
| 49 base::string16 masked_card_number_; | |
| 50 std::string card_type_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(CvcUnmaskViewController); | |
| 53 }; | |
| 54 | |
| 55 } // namespace payments | |
| 56 | |
| 57 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CVC_UNMASK_VIEW_CONTROLLER_H_ | |
| OLD | NEW |