| 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/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 base::WeakPtr<CardUnmaskDelegate> delegate); | 35 base::WeakPtr<CardUnmaskDelegate> delegate); |
| 36 // The CVC the user entered went through validation. | 36 // The CVC the user entered went through validation. |
| 37 void OnVerificationResult(AutofillClient::GetRealPanResult result); | 37 void OnVerificationResult(AutofillClient::GetRealPanResult result); |
| 38 | 38 |
| 39 // CardUnmaskPromptController implementation. | 39 // CardUnmaskPromptController implementation. |
| 40 void OnUnmaskDialogClosed() override; | 40 void OnUnmaskDialogClosed() override; |
| 41 void OnUnmaskResponse(const base::string16& cvc, | 41 void OnUnmaskResponse(const base::string16& cvc, |
| 42 const base::string16& exp_month, | 42 const base::string16& exp_month, |
| 43 const base::string16& exp_year, | 43 const base::string16& exp_year, |
| 44 bool should_store_pan) override; | 44 bool should_store_pan) override; |
| 45 | 45 void NewCardLinkClicked() override; |
| 46 content::WebContents* GetWebContents() override; | 46 content::WebContents* GetWebContents() override; |
| 47 base::string16 GetWindowTitle() const override; | 47 base::string16 GetWindowTitle() const override; |
| 48 base::string16 GetInstructionsMessage() const override; | 48 base::string16 GetInstructionsMessage() const override; |
| 49 int GetCvcImageRid() const override; | 49 int GetCvcImageRid() const override; |
| 50 bool ShouldRequestExpirationDate() const override; | 50 bool ShouldRequestExpirationDate() const override; |
| 51 bool CanStoreLocally() const override; | 51 bool CanStoreLocally() const override; |
| 52 bool GetStoreLocallyStartState() const override; | 52 bool GetStoreLocallyStartState() const override; |
| 53 bool InputCvcIsValid(const base::string16& input_text) const override; | 53 bool InputCvcIsValid(const base::string16& input_text) const override; |
| 54 bool InputExpirationIsValid(const base::string16& month, | 54 bool InputExpirationIsValid(const base::string16& month, |
| 55 const base::string16& year) const override; | 55 const base::string16& year) const override; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 67 CardUnmaskPromptView* view() { return card_unmask_view_; } | 67 CardUnmaskPromptView* view() { return card_unmask_view_; } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 bool AllowsRetry(AutofillClient::GetRealPanResult result); | 70 bool AllowsRetry(AutofillClient::GetRealPanResult result); |
| 71 void LogOnCloseEvents(); | 71 void LogOnCloseEvents(); |
| 72 AutofillMetrics::UnmaskPromptEvent GetCloseReasonEvent(); | 72 AutofillMetrics::UnmaskPromptEvent GetCloseReasonEvent(); |
| 73 | 73 |
| 74 content::WebContents* web_contents_; | 74 content::WebContents* web_contents_; |
| 75 RiskDataCallback risk_data_callback_; | 75 RiskDataCallback risk_data_callback_; |
| 76 PrefService* pref_service_; | 76 PrefService* pref_service_; |
| 77 bool new_card_link_clicked_; |
| 77 bool is_off_the_record_; | 78 bool is_off_the_record_; |
| 78 CreditCard card_; | 79 CreditCard card_; |
| 79 base::WeakPtr<CardUnmaskDelegate> delegate_; | 80 base::WeakPtr<CardUnmaskDelegate> delegate_; |
| 80 CardUnmaskPromptView* card_unmask_view_; | 81 CardUnmaskPromptView* card_unmask_view_; |
| 81 | 82 |
| 82 AutofillClient::GetRealPanResult unmasking_result_; | 83 AutofillClient::GetRealPanResult unmasking_result_; |
| 83 bool unmasking_initial_should_store_pan_; | 84 bool unmasking_initial_should_store_pan_; |
| 84 int unmasking_number_of_attempts_; | 85 int unmasking_number_of_attempts_; |
| 85 base::Time shown_timestamp_; | 86 base::Time shown_timestamp_; |
| 86 // Timestamp of the last time the user clicked the Verify button. | 87 // Timestamp of the last time the user clicked the Verify button. |
| 87 base::Time verify_timestamp_; | 88 base::Time verify_timestamp_; |
| 88 | 89 |
| 89 CardUnmaskDelegate::UnmaskResponse pending_response_; | 90 CardUnmaskDelegate::UnmaskResponse pending_response_; |
| 90 | 91 |
| 91 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; | 92 base::WeakPtrFactory<CardUnmaskPromptControllerImpl> weak_pointer_factory_; |
| 92 | 93 |
| 93 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); | 94 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptControllerImpl); |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 } // namespace autofill | 97 } // namespace autofill |
| 97 | 98 |
| 98 #endif // CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ | 99 #endif // CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_CONTROLLER_IMPL_H_ |
| OLD | NEW |