| 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 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 if (card_unmask_view_) | 41 if (card_unmask_view_) |
| 42 card_unmask_view_->ControllerGone(); | 42 card_unmask_view_->ControllerGone(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void CardUnmaskPromptControllerImpl::ShowPrompt( | 45 void CardUnmaskPromptControllerImpl::ShowPrompt( |
| 46 const CreditCard& card, | 46 const CreditCard& card, |
| 47 base::WeakPtr<CardUnmaskDelegate> delegate) { | 47 base::WeakPtr<CardUnmaskDelegate> delegate) { |
| 48 if (card_unmask_view_) | 48 if (card_unmask_view_) |
| 49 card_unmask_view_->ControllerGone(); | 49 card_unmask_view_->ControllerGone(); |
| 50 | 50 |
| 51 new_card_link_clicked_ = false; |
| 51 shown_timestamp_ = base::Time::Now(); | 52 shown_timestamp_ = base::Time::Now(); |
| 52 pending_response_ = CardUnmaskDelegate::UnmaskResponse(); | 53 pending_response_ = CardUnmaskDelegate::UnmaskResponse(); |
| 53 LoadRiskFingerprint(); | 54 LoadRiskFingerprint(); |
| 54 card_ = card; | 55 card_ = card; |
| 55 delegate_ = delegate; | 56 delegate_ = delegate; |
| 56 card_unmask_view_ = CreateAndShowView(); | 57 card_unmask_view_ = CreateAndShowView(); |
| 57 unmasking_result_ = AutofillClient::NONE; | 58 unmasking_result_ = AutofillClient::NONE; |
| 58 unmasking_number_of_attempts_ = 0; | 59 unmasking_number_of_attempts_ = 0; |
| 59 unmasking_initial_should_store_pan_ = GetStoreLocallyStartState(); | 60 unmasking_initial_should_store_pan_ = GetStoreLocallyStartState(); |
| 60 AutofillMetrics::LogUnmaskPromptEvent(AutofillMetrics::UNMASK_PROMPT_SHOWN); | 61 AutofillMetrics::LogUnmaskPromptEvent(AutofillMetrics::UNMASK_PROMPT_SHOWN); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 } | 321 } |
| 321 | 322 |
| 322 void CardUnmaskPromptControllerImpl::OnDidLoadRiskFingerprint( | 323 void CardUnmaskPromptControllerImpl::OnDidLoadRiskFingerprint( |
| 323 const std::string& risk_data) { | 324 const std::string& risk_data) { |
| 324 pending_response_.risk_data = risk_data; | 325 pending_response_.risk_data = risk_data; |
| 325 if (!pending_response_.cvc.empty()) | 326 if (!pending_response_.cvc.empty()) |
| 326 delegate_->OnUnmaskResponse(pending_response_); | 327 delegate_->OnUnmaskResponse(pending_response_); |
| 327 } | 328 } |
| 328 | 329 |
| 329 } // namespace autofill | 330 } // namespace autofill |
| OLD | NEW |