| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" | 9 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" |
| 10 #include "components/autofill/core/browser/credit_card.h" | 10 #include "components/autofill/core/browser/credit_card.h" |
| 11 | 11 |
| 12 namespace autofill { | 12 namespace autofill { |
| 13 | 13 |
| 14 class CardUnmaskDelegate; | 14 class CardUnmaskDelegate; |
| 15 class CardUnmaskPromptView; | 15 class CardUnmaskPromptView; |
| 16 | 16 |
| 17 class CardUnmaskPromptControllerImpl : public CardUnmaskPromptController { | 17 class CardUnmaskPromptControllerImpl : public CardUnmaskPromptController { |
| 18 public: | 18 public: |
| 19 explicit CardUnmaskPromptControllerImpl(content::WebContents* web_contents); | 19 explicit CardUnmaskPromptControllerImpl(content::WebContents* web_contents); |
| 20 ~CardUnmaskPromptControllerImpl(); | 20 ~CardUnmaskPromptControllerImpl(); |
| 21 | 21 |
| 22 // Functions called by ChromeAutofillClient. | 22 // Functions called by ChromeAutofillClient. |
| 23 void ShowPrompt(const CreditCard& card, | 23 void ShowPrompt(const CreditCard& card, |
| 24 base::WeakPtr<CardUnmaskDelegate> delegate); | 24 base::WeakPtr<CardUnmaskDelegate> delegate); |
| 25 // The CVC the user entered went through validation. | 25 // The CVC the user entered went through validation. |
| 26 void OnVerificationResult(bool success); | 26 void OnVerificationResult(bool success); |
| 27 | 27 |
| 28 // CardUnmaskPromptController implementation. | 28 // CardUnmaskPromptController implementation. |
| 29 void OnUnmaskDialogClosed() override; | 29 void OnUnmaskDialogClosed() override; |
| 30 void OnUnmaskResponse(const base::string16& cvc) override; | 30 void OnUnmaskResponse(const base::string16& cvc, |
| 31 const base::string16& exp_month, |
| 32 const base::string16& exp_year) override; |
| 33 |
| 31 content::WebContents* GetWebContents() override; | 34 content::WebContents* GetWebContents() override; |
| 32 base::string16 GetWindowTitle() const override; | 35 base::string16 GetWindowTitle() const override; |
| 33 base::string16 GetInstructionsMessage() const override; | 36 base::string16 GetInstructionsMessage() const override; |
| 34 int GetCvcImageRid() const override; | 37 int GetCvcImageRid() const override; |
| 35 bool ShouldRequestExpirationDate() const override; | 38 bool ShouldRequestExpirationDate() const override; |
| 36 bool InputTextIsValid(const base::string16& input_text) const override; | 39 bool InputTextIsValid(const base::string16& input_text) const override; |
| 37 | 40 |
| 38 private: | 41 private: |
| 39 content::WebContents* web_contents_; | 42 content::WebContents* web_contents_; |
| 40 CreditCard card_; | 43 CreditCard card_; |
| 41 base::WeakPtr<CardUnmaskDelegate> delegate_; | 44 base::WeakPtr<CardUnmaskDelegate> delegate_; |
| 42 CardUnmaskPromptView* card_unmask_view_; | 45 CardUnmaskPromptView* card_unmask_view_; |
| 43 | 46 |
| 44 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; | 47 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; |
| 45 | 48 |
| 46 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); | 49 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 } // namespace autofill | 52 } // namespace autofill |
| 50 | 53 |
| 51 #endif // CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ | 54 #endif // CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ |
| OLD | NEW |