Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc

Issue 1137623006: [android] Handle re-issued cards in unmasking prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698