| 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 25 matching lines...) Expand all Loading... |
| 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 GetStoreLocallyStartState() const override; | 42 bool GetStoreLocallyStartState() const override; |
| 43 bool InputCvcIsValid(const base::string16& input_text) const override; | 43 bool InputCvcIsValid(const base::string16& input_text) const override; |
| 44 bool InputExpirationIsValid(const base::string16& month, | 44 bool InputExpirationIsValid(const base::string16& month, |
| 45 const base::string16& year) const override; | 45 const base::string16& year) const override; |
| 46 base::TimeDelta GetSuccessMessageDuration() const override; |
| 46 | 47 |
| 47 protected: | 48 protected: |
| 48 // Virtual so tests can suppress it. | 49 // Virtual so tests can suppress it. |
| 49 virtual CardUnmaskPromptView* CreateAndShowView(); | 50 virtual CardUnmaskPromptView* CreateAndShowView(); |
| 50 virtual void LoadRiskFingerprint(); | 51 virtual void LoadRiskFingerprint(); |
| 51 | 52 |
| 52 virtual void OnDidLoadRiskFingerprint(const std::string& risk_data); | 53 // Protected so tests can call it. |
| 54 void OnDidLoadRiskFingerprint(const std::string& risk_data); |
| 53 | 55 |
| 54 // Exposed for testing. | 56 // Exposed for testing. |
| 55 CardUnmaskPromptView* view() { return card_unmask_view_; } | 57 CardUnmaskPromptView* view() { return card_unmask_view_; } |
| 56 | 58 |
| 57 private: | 59 private: |
| 58 | |
| 59 bool AllowsRetry(AutofillClient::GetRealPanResult result); | 60 bool AllowsRetry(AutofillClient::GetRealPanResult result); |
| 60 void LogOnCloseEvents(); | 61 void LogOnCloseEvents(); |
| 61 | 62 |
| 62 content::WebContents* web_contents_; | 63 content::WebContents* web_contents_; |
| 63 CreditCard card_; | 64 CreditCard card_; |
| 64 base::WeakPtr<CardUnmaskDelegate> delegate_; | 65 base::WeakPtr<CardUnmaskDelegate> delegate_; |
| 65 CardUnmaskPromptView* card_unmask_view_; | 66 CardUnmaskPromptView* card_unmask_view_; |
| 66 | 67 |
| 67 AutofillClient::GetRealPanResult unmasking_result_; | 68 AutofillClient::GetRealPanResult unmasking_result_; |
| 68 bool unmasking_initial_should_store_pan_; | 69 bool unmasking_initial_should_store_pan_; |
| 69 int unmasking_number_of_attempts_; | 70 int unmasking_number_of_attempts_; |
| 70 bool unmasking_allow_retry_; | 71 bool unmasking_allow_retry_; |
| 71 | 72 |
| 72 CardUnmaskDelegate::UnmaskResponse pending_response_; | 73 CardUnmaskDelegate::UnmaskResponse pending_response_; |
| 73 | 74 |
| 74 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; | 75 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; |
| 75 | 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); | 77 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace autofill | 80 } // namespace autofill |
| 80 | 81 |
| 81 #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 |