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

Side by Side Diff: components/autofill/core/browser/autofill_external_delegate.cc

Issue 828063004: Update Android Card Unmask prompt to rely on the controller a bit more. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use newt's description Created 5 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/core/browser/autofill_external_delegate.h" 5 #include "components/autofill/core/browser/autofill_external_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return; 97 return;
98 98
99 std::vector<Suggestion> suggestions(input_suggestions); 99 std::vector<Suggestion> suggestions(input_suggestions);
100 100
101 // Add or hide warnings as appropriate. 101 // Add or hide warnings as appropriate.
102 ApplyAutofillWarnings(&suggestions); 102 ApplyAutofillWarnings(&suggestions);
103 103
104 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 104 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
105 switches::kEnableWalletCardImport)) { 105 switches::kEnableWalletCardImport)) {
106 // For now, add a fake masked card. 106 // For now, add a fake masked card.
107 suggestions.push_back(Suggestion( 107 suggestions.push_back(Suggestion("Amex - 8431", "[tap to unlock]", "",
108 "Visa - 1111", "[tap to unlock]", "", 108 POPUP_ITEM_ID_FAKE_MASKED_INSTRUMENT));
109 POPUP_ITEM_ID_FAKE_MASKED_INSTRUMENT));
110 } 109 }
111 110
112 // Add a separator to go between the values and menu items. 111 // Add a separator to go between the values and menu items.
113 suggestions.push_back(Suggestion()); 112 suggestions.push_back(Suggestion());
114 suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR; 113 suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR;
115 114
116 if (should_show_scan_credit_card_) { 115 if (should_show_scan_credit_card_) {
117 Suggestion scan_credit_card( 116 Suggestion scan_credit_card(
118 l10n_util::GetStringUTF16(IDS_AUTOFILL_SCAN_CREDIT_CARD)); 117 l10n_util::GetStringUTF16(IDS_AUTOFILL_SCAN_CREDIT_CARD));
119 scan_credit_card.frontend_id = POPUP_ITEM_ID_SCAN_CREDIT_CARD; 118 scan_credit_card.frontend_id = POPUP_ITEM_ID_SCAN_CREDIT_CARD;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 void AutofillExternalDelegate::OnUnmaskVerificationResult(bool success) { 441 void AutofillExternalDelegate::OnUnmaskVerificationResult(bool success) {
443 if (success) { 442 if (success) {
444 CreditCard fake_card(base::ASCIIToUTF16("371449635398431"), 5, 2016); 443 CreditCard fake_card(base::ASCIIToUTF16("371449635398431"), 5, 2016);
445 manager_->FillCreditCardForm(query_id_, query_form_, query_field_, 444 manager_->FillCreditCardForm(query_id_, query_form_, query_field_,
446 fake_card); 445 fake_card);
447 } 446 }
448 manager_->client()->OnUnmaskVerificationResult(success); 447 manager_->client()->OnUnmaskVerificationResult(success);
449 } 448 }
450 449
451 } // namespace autofill 450 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698