| 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 27 matching lines...) Expand all Loading... |
| 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 | 46 |
| 47 protected: | 47 protected: |
| 48 // Virtual so tests can suppress it. |
| 49 virtual CardUnmaskPromptView* CreateAndShowView(); |
| 50 virtual void LoadRiskFingerprint(); |
| 51 |
| 48 virtual void OnDidLoadRiskFingerprint(const std::string& risk_data); | 52 virtual void OnDidLoadRiskFingerprint(const std::string& risk_data); |
| 49 | 53 |
| 50 // Exposed for testing. | 54 // Exposed for testing. |
| 51 CardUnmaskPromptView* view() { return card_unmask_view_; } | 55 CardUnmaskPromptView* view() { return card_unmask_view_; } |
| 52 | 56 |
| 53 private: | 57 private: |
| 54 void LoadRiskFingerprint(); | |
| 55 | 58 |
| 56 content::WebContents* web_contents_; | 59 content::WebContents* web_contents_; |
| 57 CreditCard card_; | 60 CreditCard card_; |
| 58 base::WeakPtr<CardUnmaskDelegate> delegate_; | 61 base::WeakPtr<CardUnmaskDelegate> delegate_; |
| 59 CardUnmaskPromptView* card_unmask_view_; | 62 CardUnmaskPromptView* card_unmask_view_; |
| 60 | 63 |
| 64 bool unmasking_success_; |
| 65 bool unmasking_initial_should_store_pan_; |
| 66 int unmasking_number_of_attempts_; |
| 67 bool unmasking_allow_retry_; |
| 68 |
| 61 CardUnmaskDelegate::UnmaskResponse pending_response_; | 69 CardUnmaskDelegate::UnmaskResponse pending_response_; |
| 62 | 70 |
| 63 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; | 71 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; |
| 64 | 72 |
| 65 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); | 73 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); |
| 66 }; | 74 }; |
| 67 | 75 |
| 68 } // namespace autofill | 76 } // namespace autofill |
| 69 | 77 |
| 70 #endif // CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ | 78 #endif // CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ |
| OLD | NEW |