| OLD | NEW |
| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 base::WeakPtr<AutofillExternalDelegate> AutofillExternalDelegate::GetWeakPtr() { | 242 base::WeakPtr<AutofillExternalDelegate> AutofillExternalDelegate::GetWeakPtr() { |
| 243 return weak_ptr_factory_.GetWeakPtr(); | 243 return weak_ptr_factory_.GetWeakPtr(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void AutofillExternalDelegate::OnCreditCardScanned( | 246 void AutofillExternalDelegate::OnCreditCardScanned( |
| 247 const base::string16& card_number, | 247 const base::string16& card_number, |
| 248 int expiration_month, | 248 int expiration_month, |
| 249 int expiration_year) { | 249 int expiration_year) { |
| 250 manager_->FillCreditCardForm( | 250 manager_->FillCreditCardForm( |
| 251 query_id_, query_form_, query_field_, | 251 query_id_, query_form_, query_field_, |
| 252 CreditCard(card_number, expiration_month, expiration_year)); | 252 CreditCard(card_number, expiration_month, expiration_year), |
| 253 base::string16()); |
| 253 } | 254 } |
| 254 | 255 |
| 255 void AutofillExternalDelegate::FillAutofillFormData(int unique_id, | 256 void AutofillExternalDelegate::FillAutofillFormData(int unique_id, |
| 256 bool is_preview) { | 257 bool is_preview) { |
| 257 // If the selected element is a warning we don't want to do anything. | 258 // If the selected element is a warning we don't want to do anything. |
| 258 if (unique_id == POPUP_ITEM_ID_WARNING_MESSAGE) | 259 if (unique_id == POPUP_ITEM_ID_WARNING_MESSAGE) |
| 259 return; | 260 return; |
| 260 | 261 |
| 261 AutofillDriver::RendererFormDataAction renderer_action = is_preview ? | 262 AutofillDriver::RendererFormDataAction renderer_action = is_preview ? |
| 262 AutofillDriver::FORM_DATA_ACTION_PREVIEW : | 263 AutofillDriver::FORM_DATA_ACTION_PREVIEW : |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 suggestions->insert(suggestions->begin(), data_list_values_.size(), | 340 suggestions->insert(suggestions->begin(), data_list_values_.size(), |
| 340 Suggestion()); | 341 Suggestion()); |
| 341 for (size_t i = 0; i < data_list_values_.size(); i++) { | 342 for (size_t i = 0; i < data_list_values_.size(); i++) { |
| 342 (*suggestions)[i].value = data_list_values_[i]; | 343 (*suggestions)[i].value = data_list_values_[i]; |
| 343 (*suggestions)[i].label = data_list_labels_[i]; | 344 (*suggestions)[i].label = data_list_labels_[i]; |
| 344 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; | 345 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; |
| 345 } | 346 } |
| 346 } | 347 } |
| 347 | 348 |
| 348 } // namespace autofill | 349 } // namespace autofill |
| OLD | NEW |