| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 driver_->RendererShouldAcceptDataListSuggestion(value); | 218 driver_->RendererShouldAcceptDataListSuggestion(value); |
| 219 } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { | 219 } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { |
| 220 // User selected an Autocomplete, so we fill directly. | 220 // User selected an Autocomplete, so we fill directly. |
| 221 driver_->RendererShouldFillFieldWithValue(value); | 221 driver_->RendererShouldFillFieldWithValue(value); |
| 222 AutofillMetrics::LogAutocompleteSuggestionAcceptedIndex(position); | 222 AutofillMetrics::LogAutocompleteSuggestionAcceptedIndex(position); |
| 223 } else if (identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD) { | 223 } else if (identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD) { |
| 224 manager_->client()->ScanCreditCard(base::Bind( | 224 manager_->client()->ScanCreditCard(base::Bind( |
| 225 &AutofillExternalDelegate::OnCreditCardScanned, GetWeakPtr())); | 225 &AutofillExternalDelegate::OnCreditCardScanned, GetWeakPtr())); |
| 226 } else if (identifier == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) { | 226 } else if (identifier == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) { |
| 227 manager_->client()->StartSigninFlow(); | 227 manager_->client()->StartSigninFlow(); |
| 228 } else if (identifier == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) { |
| 229 manager_->client()->ShowHttpNotSecureExplanation(); |
| 228 } else { | 230 } else { |
| 229 if (identifier > 0) // Denotes an Autofill suggestion. | 231 if (identifier > 0) // Denotes an Autofill suggestion. |
| 230 AutofillMetrics::LogAutofillSuggestionAcceptedIndex(position); | 232 AutofillMetrics::LogAutofillSuggestionAcceptedIndex(position); |
| 231 | 233 |
| 232 FillAutofillFormData(identifier, false); | 234 FillAutofillFormData(identifier, false); |
| 233 } | 235 } |
| 234 | 236 |
| 235 if (should_show_scan_credit_card_) { | 237 if (should_show_scan_credit_card_) { |
| 236 AutofillMetrics::LogScanCreditCardPromptMetric( | 238 AutofillMetrics::LogScanCreditCardPromptMetric( |
| 237 identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD | 239 identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 suggestions->insert(suggestions->begin(), data_list_values_.size(), | 376 suggestions->insert(suggestions->begin(), data_list_values_.size(), |
| 375 Suggestion()); | 377 Suggestion()); |
| 376 for (size_t i = 0; i < data_list_values_.size(); i++) { | 378 for (size_t i = 0; i < data_list_values_.size(); i++) { |
| 377 (*suggestions)[i].value = data_list_values_[i]; | 379 (*suggestions)[i].value = data_list_values_[i]; |
| 378 (*suggestions)[i].label = data_list_labels_[i]; | 380 (*suggestions)[i].label = data_list_labels_[i]; |
| 379 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; | 381 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; |
| 380 } | 382 } |
| 381 } | 383 } |
| 382 | 384 |
| 383 } // namespace autofill | 385 } // namespace autofill |
| OLD | NEW |