| 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/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" | 10 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 void OnUnmaskResponse(const base::string16& cvc, | 32 void OnUnmaskResponse(const base::string16& cvc, |
| 33 const base::string16& exp_month, | 33 const base::string16& exp_month, |
| 34 const base::string16& exp_year, | 34 const base::string16& exp_year, |
| 35 bool should_store_pan) override; | 35 bool should_store_pan) override; |
| 36 | 36 |
| 37 content::WebContents* GetWebContents() override; | 37 content::WebContents* GetWebContents() override; |
| 38 base::string16 GetWindowTitle() const override; | 38 base::string16 GetWindowTitle() const override; |
| 39 base::string16 GetInstructionsMessage() const override; | 39 base::string16 GetInstructionsMessage() const override; |
| 40 int GetCvcImageRid() const override; | 40 int GetCvcImageRid() const override; |
| 41 bool ShouldRequestExpirationDate() const override; | 41 bool ShouldRequestExpirationDate() const override; |
| 42 bool CanStoreLocally() const override; |
| 42 bool GetStoreLocallyStartState() const override; | 43 bool GetStoreLocallyStartState() const override; |
| 43 bool InputCvcIsValid(const base::string16& input_text) const override; | 44 bool InputCvcIsValid(const base::string16& input_text) const override; |
| 44 bool InputExpirationIsValid(const base::string16& month, | 45 bool InputExpirationIsValid(const base::string16& month, |
| 45 const base::string16& year) const override; | 46 const base::string16& year) const override; |
| 46 base::TimeDelta GetSuccessMessageDuration() const override; | 47 base::TimeDelta GetSuccessMessageDuration() const override; |
| 47 | 48 |
| 48 protected: | 49 protected: |
| 49 // Virtual so tests can suppress it. | 50 // Virtual so tests can suppress it. |
| 50 virtual CardUnmaskPromptView* CreateAndShowView(); | 51 virtual CardUnmaskPromptView* CreateAndShowView(); |
| 51 virtual void LoadRiskFingerprint(); | 52 virtual void LoadRiskFingerprint(); |
| 52 | 53 |
| 53 // Protected so tests can call it. | 54 // Protected so tests can call it. |
| 54 void OnDidLoadRiskFingerprint(const std::string& risk_data); | 55 void OnDidLoadRiskFingerprint(const std::string& risk_data); |
| 55 | 56 |
| 56 // Exposed for testing. | 57 // Exposed for testing. |
| 57 CardUnmaskPromptView* view() { return card_unmask_view_; } | 58 CardUnmaskPromptView* view() { return card_unmask_view_; } |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 bool AllowsRetry(AutofillClient::GetRealPanResult result); | 61 bool AllowsRetry(AutofillClient::GetRealPanResult result); |
| 61 void LogOnCloseEvents(); | 62 void LogOnCloseEvents(); |
| 62 | 63 |
| 63 content::WebContents* web_contents_; | 64 content::WebContents* web_contents_; |
| 64 CreditCard card_; | 65 CreditCard card_; |
| 65 base::WeakPtr<CardUnmaskDelegate> delegate_; | 66 base::WeakPtr<CardUnmaskDelegate> delegate_; |
| 66 CardUnmaskPromptView* card_unmask_view_; | 67 CardUnmaskPromptView* card_unmask_view_; |
| 67 | 68 |
| 68 AutofillClient::GetRealPanResult unmasking_result_; | 69 AutofillClient::GetRealPanResult unmasking_result_; |
| 69 bool unmasking_initial_should_store_pan_; | 70 bool unmasking_initial_should_store_pan_; |
| 70 int unmasking_number_of_attempts_; | 71 int unmasking_number_of_attempts_; |
| 71 bool unmasking_allow_retry_; | |
| 72 | 72 |
| 73 CardUnmaskDelegate::UnmaskResponse pending_response_; | 73 CardUnmaskDelegate::UnmaskResponse pending_response_; |
| 74 | 74 |
| 75 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; | 75 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); | 77 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace autofill | 80 } // namespace autofill |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ | 82 #endif // CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ |
| OLD | NEW |