| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) { | 221 } else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) { |
| 222 driver_->RendererShouldAcceptDataListSuggestion(value); | 222 driver_->RendererShouldAcceptDataListSuggestion(value); |
| 223 } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { | 223 } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { |
| 224 // User selected an Autocomplete, so we fill directly. | 224 // User selected an Autocomplete, so we fill directly. |
| 225 driver_->RendererShouldFillFieldWithValue(value); | 225 driver_->RendererShouldFillFieldWithValue(value); |
| 226 AutofillMetrics::LogAutocompleteSuggestionAcceptedIndex(position); | 226 AutofillMetrics::LogAutocompleteSuggestionAcceptedIndex(position); |
| 227 } else if (identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD) { | 227 } else if (identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD) { |
| 228 manager_->client()->ScanCreditCard(base::Bind( | 228 manager_->client()->ScanCreditCard(base::Bind( |
| 229 &AutofillExternalDelegate::OnCreditCardScanned, GetWeakPtr())); | 229 &AutofillExternalDelegate::OnCreditCardScanned, GetWeakPtr())); |
| 230 } else if (identifier == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) { | 230 } else if (identifier == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) { |
| 231 manager_->client()->StartSigninFlow(); | 231 manager_->client()->ExecuteCommand( |
| 232 autofill::POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO); |
| 232 } else if (identifier == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) { | 233 } else if (identifier == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) { |
| 233 AutofillMetrics::LogShowedHttpNotSecureExplanation(); | 234 AutofillMetrics::LogShowedHttpNotSecureExplanation(); |
| 234 manager_->client()->ShowHttpNotSecureExplanation(); | 235 manager_->client()->ExecuteCommand( |
| 236 autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE); |
| 235 } else { | 237 } else { |
| 236 if (identifier > 0) // Denotes an Autofill suggestion. | 238 if (identifier > 0) // Denotes an Autofill suggestion. |
| 237 AutofillMetrics::LogAutofillSuggestionAcceptedIndex(position); | 239 AutofillMetrics::LogAutofillSuggestionAcceptedIndex(position); |
| 238 | 240 |
| 239 FillAutofillFormData(identifier, false); | 241 FillAutofillFormData(identifier, false); |
| 240 } | 242 } |
| 241 | 243 |
| 242 if (should_show_scan_credit_card_) { | 244 if (should_show_scan_credit_card_) { |
| 243 AutofillMetrics::LogScanCreditCardPromptMetric( | 245 AutofillMetrics::LogScanCreditCardPromptMetric( |
| 244 identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD | 246 identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 const { | 408 const { |
| 407 if (IsKeyboardAccessoryEnabled()) { | 409 if (IsKeyboardAccessoryEnabled()) { |
| 408 return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); | 410 return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); |
| 409 } | 411 } |
| 410 return l10n_util::GetStringUTF16(is_credit_card_popup_ ? | 412 return l10n_util::GetStringUTF16(is_credit_card_popup_ ? |
| 411 IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : | 413 IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : |
| 412 IDS_AUTOFILL_OPTIONS_POPUP); | 414 IDS_AUTOFILL_OPTIONS_POPUP); |
| 413 } | 415 } |
| 414 | 416 |
| 415 } // namespace autofill | 417 } // namespace autofill |
| OLD | NEW |