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

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

Issue 2249773002: Scan card holder name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass CreditCard, don't alter the constructor. Created 4 years, 4 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 void AutofillExternalDelegate::OnPingAck() { 260 void AutofillExternalDelegate::OnPingAck() {
261 // Reissue the most recent query, which will reopen the Autofill popup. 261 // Reissue the most recent query, which will reopen the Autofill popup.
262 manager_->OnQueryFormFieldAutofill(query_id_, query_form_, query_field_, 262 manager_->OnQueryFormFieldAutofill(query_id_, query_form_, query_field_,
263 element_bounds_); 263 element_bounds_);
264 } 264 }
265 265
266 base::WeakPtr<AutofillExternalDelegate> AutofillExternalDelegate::GetWeakPtr() { 266 base::WeakPtr<AutofillExternalDelegate> AutofillExternalDelegate::GetWeakPtr() {
267 return weak_ptr_factory_.GetWeakPtr(); 267 return weak_ptr_factory_.GetWeakPtr();
268 } 268 }
269 269
270 void AutofillExternalDelegate::OnCreditCardScanned( 270 void AutofillExternalDelegate::OnCreditCardScanned(const CreditCard& card) {
271 const base::string16& card_number, 271 manager_->FillCreditCardForm(query_id_, query_form_, query_field_, card,
272 int expiration_month, 272 base::string16());
273 int expiration_year) {
274 manager_->FillCreditCardForm(
275 query_id_, query_form_, query_field_,
276 CreditCard(card_number, expiration_month, expiration_year),
277 base::string16());
278 } 273 }
279 274
280 void AutofillExternalDelegate::FillAutofillFormData(int unique_id, 275 void AutofillExternalDelegate::FillAutofillFormData(int unique_id,
281 bool is_preview) { 276 bool is_preview) {
282 // If the selected element is a warning we don't want to do anything. 277 // If the selected element is a warning we don't want to do anything.
283 if (unique_id == POPUP_ITEM_ID_WARNING_MESSAGE) 278 if (unique_id == POPUP_ITEM_ID_WARNING_MESSAGE)
284 return; 279 return;
285 280
286 AutofillDriver::RendererFormDataAction renderer_action = is_preview ? 281 AutofillDriver::RendererFormDataAction renderer_action = is_preview ?
287 AutofillDriver::FORM_DATA_ACTION_PREVIEW : 282 AutofillDriver::FORM_DATA_ACTION_PREVIEW :
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 suggestions->insert(suggestions->begin(), data_list_values_.size(), 359 suggestions->insert(suggestions->begin(), data_list_values_.size(),
365 Suggestion()); 360 Suggestion());
366 for (size_t i = 0; i < data_list_values_.size(); i++) { 361 for (size_t i = 0; i < data_list_values_.size(); i++) {
367 (*suggestions)[i].value = data_list_values_[i]; 362 (*suggestions)[i].value = data_list_values_[i];
368 (*suggestions)[i].label = data_list_labels_[i]; 363 (*suggestions)[i].label = data_list_labels_[i];
369 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; 364 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY;
370 } 365 }
371 } 366 }
372 367
373 } // namespace autofill 368 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698